Search in sources :

Example 6 with DecryptedGroupJoinInfo

use of org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo 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 7 with DecryptedGroupJoinInfo

use of org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo 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)

Example 8 with DecryptedGroupJoinInfo

use of org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_groupJoinInfo_Test method decrypt_description_field_8.

@Test
public void decrypt_description_field_8() {
    GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setDescription(groupOperations.encryptDescription("Description!")).build();
    DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
    assertEquals("Description!", decryptedGroupJoinInfo.getDescription());
}
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 9 with DecryptedGroupJoinInfo

use of org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_groupJoinInfo_Test method pending_approval_passed_though_7_true.

@Test
public void pending_approval_passed_though_7_true() {
    GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setPendingAdminApproval(true).build();
    DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
    assertTrue(decryptedGroupJoinInfo.getPendingAdminApproval());
}
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 10 with DecryptedGroupJoinInfo

use of org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_groupJoinInfo_Test method add_from_invite_link_access_control_passed_though_5_any.

@Test
public void add_from_invite_link_access_control_passed_though_5_any() {
    GroupJoinInfo groupJoinInfo = GroupJoinInfo.newBuilder().setAddFromInviteLink(AccessControl.AccessRequired.ANY).build();
    DecryptedGroupJoinInfo decryptedGroupJoinInfo = groupOperations.decryptGroupJoinInfo(groupJoinInfo);
    assertEquals(AccessControl.AccessRequired.ANY, decryptedGroupJoinInfo.getAddFromInviteLink());
}
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

DecryptedGroupJoinInfo (org.signal.storageservice.protos.groups.local.DecryptedGroupJoinInfo)12 GroupJoinInfo (org.signal.storageservice.protos.groups.GroupJoinInfo)10 Test (org.junit.Test)9 Bitmap (android.graphics.Bitmap)1 NonNull (androidx.annotation.NonNull)1 WorkerThread (androidx.annotation.WorkerThread)1 IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 VerificationFailedException (org.signal.zkgroup.VerificationFailedException)1 GroupMasterKey (org.signal.zkgroup.groups.GroupMasterKey)1 Attachment (org.thoughtcrime.securesms.attachments.Attachment)1 UriAttachment (org.thoughtcrime.securesms.attachments.UriAttachment)1 GroupDatabase (org.thoughtcrime.securesms.database.GroupDatabase)1 GroupId (org.thoughtcrime.securesms.groups.GroupId)1 GroupInviteLinkUrl (org.thoughtcrime.securesms.groups.v2.GroupInviteLinkUrl)1 Recipient (org.thoughtcrime.securesms.recipients.Recipient)1 GroupLinkNotActiveException (org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException)1 ForbiddenException (org.whispersystems.signalservice.internal.push.exceptions.ForbiddenException)1