Search in sources :

Example 1 with GroupJoinInfo

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();
    }
}
Also used : DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) GroupJoinInfo(org.signal.storageservice.protos.groups.GroupJoinInfo) ForbiddenException(org.whispersystems.signalservice.internal.push.exceptions.ForbiddenException)

Example 2 with GroupJoinInfo

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());
}
Also used : DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) GroupJoinInfo(org.signal.storageservice.protos.groups.GroupJoinInfo) DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) Test(org.junit.Test)

Example 3 with GroupJoinInfo

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());
}
Also used : DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) GroupJoinInfo(org.signal.storageservice.protos.groups.GroupJoinInfo) DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) Test(org.junit.Test)

Example 4 with GroupJoinInfo

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());
}
Also used : DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) GroupJoinInfo(org.signal.storageservice.protos.groups.GroupJoinInfo) DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) Test(org.junit.Test)

Example 5 with GroupJoinInfo

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());
}
Also used : DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) GroupJoinInfo(org.signal.storageservice.protos.groups.GroupJoinInfo) DecryptedGroupJoinInfo(org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo) Test(org.junit.Test)

Aggregations

GroupJoinInfo (org.signal.storageservice.protos.groups.GroupJoinInfo)10 DecryptedGroupJoinInfo (org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo)10 Test (org.junit.Test)9 ForbiddenException (org.whispersystems.signalservice.internal.push.exceptions.ForbiddenException)1