use of org.signal.storageservice.protos.groups.GroupJoinInfo in project Signal-Android by WhisperSystems.
the class GroupsV2Api method getGroupJoinInfo.
public DecryptedGroupJoinInfo getGroupJoinInfo(GroupSecretParams groupSecretParams, Optional<byte[]> password, GroupsV2AuthorizationString authorization) throws IOException, GroupLinkNotActiveException {
try {
GroupJoinInfo joinInfo = socket.getGroupJoinInfo(password, authorization);
GroupsV2Operations.GroupOperations groupOperations = groupsOperations.forGroup(groupSecretParams);
return groupOperations.decryptGroupJoinInfo(joinInfo);
} catch (ForbiddenException e) {
throw new GroupLinkNotActiveException();
}
}
use of org.signal.storageservice.protos.groups.GroupJoinInfo in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_groupJoinInfo_Test method decrypt_title_field_2.
@Test
public void decrypt_title_field_2() {
GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setTitle(groupOperations.encryptTitle("Title!")).build();
DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
assertEquals("Title!", decryptedGroupJoinInfo.getTitle());
}
use of org.signal.storageservice.protos.groups.GroupJoinInfo in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_groupJoinInfo_Test method member_count_passed_through_4.
@Test
public void member_count_passed_through_4() {
GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setMemberCount(97).build();
DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
assertEquals(97, decryptedGroupJoinInfo.getMemberCount());
}
use of org.signal.storageservice.protos.groups.GroupJoinInfo in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_groupJoinInfo_Test method avatar_field_passed_through_3.
@Test
public void avatar_field_passed_through_3() {
GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setAvatar("AvatarCdnKey").build();
DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
assertEquals("AvatarCdnKey", decryptedGroupJoinInfo.getAvatar());
}
use of org.signal.storageservice.protos.groups.GroupJoinInfo in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_groupJoinInfo_Test method revision_passed_though_6.
@Test
public void revision_passed_though_6() {
GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setRevision(11).build();
DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
assertEquals(11, decryptedGroupJoinInfo.getRevision());
}
Aggregations