Color Android member phone actions using live call presence
This commit is contained in:
1 parent
a1f8eaeec2
commit
94e79e5630
3 files changed
+20
-1
No files matched your search
@@ -6,6 +6,18 @@ import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
|
||||
class MemberAvatarTest {
|
||||
@Test fun phonePresenceRequiresAnOnlinePeerAndAnExplicitKnownFlag() {
|
||||
for ((flags, known, busy) in listOf(Triple(0, false, false), Triple(0x40, true, false),
|
||||
Triple(0xC0, true, true), Triple(0x80, false, false))) {
|
||||
val bytes = ByteArray(MEMBER_WIRE_SIZE)
|
||||
bytes[8] = 1; bytes[10] = flags.toByte()
|
||||
val online = requireNotNull(parseMemberWire(bytes)).toChatMember()
|
||||
assertEquals(known, online.phoneStatusKnown); assertEquals(busy, online.phoneBusy)
|
||||
bytes[8] = 0
|
||||
val offline = requireNotNull(parseMemberWire(bytes)).toChatMember(online)
|
||||
assertFalse(offline.phoneStatusKnown); assertFalse(offline.phoneBusy)
|
||||
}
|
||||
}
|
||||
@Test fun snapshotStringsStopAtFirstNullBeforeDirtyPadding() {
|
||||
for (name in listOf("", "0x06B9", "Без имени", "x".repeat(63))) {
|
||||
val bytes = ByteArray(MEMBER_WIRE_SIZE)
|
||||
|
||||
Reference in new issue
Block a user