use of org.signal.storageservice.protos.groups.local.DecryptedGroupChange in project Signal-Android by WhisperSystems.
the class GroupChangeUtil_resolveConflict_decryptedOnly_Test method field_7__add_pending_members.
@Test
public void field_7__add_pending_members() {
UUID member1 = UUID.randomUUID();
UUID member2 = UUID.randomUUID();
UUID member3 = UUID.randomUUID();
DecryptedGroup groupState = DecryptedGroup.newBuilder().addMembers(member(member1)).addPendingMembers(pendingMember(member3)).build();
DecryptedGroupChange decryptedChange = DecryptedGroupChange.newBuilder().addNewPendingMembers(pendingMember(member1)).addNewPendingMembers(pendingMember(member2)).addNewPendingMembers(pendingMember(member3)).build();
DecryptedGroupChange resolvedChanges = GroupChangeUtil.resolveConflict(groupState, decryptedChange).build();
DecryptedGroupChange expected = DecryptedGroupChange.newBuilder().addNewPendingMembers(pendingMember(member2)).build();
assertEquals(expected, resolvedChanges);
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroupChange in project Signal-Android by WhisperSystems.
the class GroupChangeUtil_resolveConflict_decryptedOnly_Test method field_12__no_timer_change_is_removed.
@Test
public void field_12__no_timer_change_is_removed() {
DecryptedGroup groupState = DecryptedGroup.newBuilder().setDisappearingMessagesTimer(DecryptedTimer.newBuilder().setDuration(123)).build();
DecryptedGroupChange decryptedChange = DecryptedGroupChange.newBuilder().setNewTimer(DecryptedTimer.newBuilder().setDuration(123)).build();
DecryptedGroupChange resolvedChanges = GroupChangeUtil.resolveConflict(groupState, decryptedChange).build();
assertTrue(DecryptedGroupUtil.changeIsEmpty(resolvedChanges));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroupChange in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method member_invited_1_person.
@Test
public void member_invited_1_person() {
DecryptedGroupChange change = changeBy(alice).invite(bob).build();
assertThat(describeChange(change), is(singletonList("Alice invited 1 person to the group.")));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroupChange in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method you_changed_attribute_access.
@Test
public void you_changed_attribute_access() {
DecryptedGroupChange change = changeBy(you).attributeAccess(AccessControl.AccessRequired.ADMINISTRATOR).build();
assertThat(describeChange(change), is(singletonList("You changed who can edit group info to \"Only admins\".")));
}
use of org.signal.storageservice.protos.groups.local.DecryptedGroupChange in project Signal-Android by WhisperSystems.
the class GroupsV2UpdateMessageProducerTest method member_cancelled_their_join_request.
@Test
public void member_cancelled_their_join_request() {
DecryptedGroupChange change = changeBy(alice).denyRequest(alice).build();
assertThat(describeChange(change), is(singletonList("Alice canceled their request to join the group.")));
}
Aggregations