mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Group invite link epoch support.
This commit is contained in:
committed by
Greyson Parrelli
parent
e006306036
commit
477bb45df7
@@ -14,6 +14,7 @@ public final class GV2AccessLevelUtil {
|
||||
|
||||
public static String toString(@NonNull Context context, @NonNull AccessControl.AccessRequired attributeAccess) {
|
||||
switch (attributeAccess) {
|
||||
case ANY : return context.getString(R.string.GroupManagement_access_level_anyone);
|
||||
case MEMBER : return context.getString(R.string.GroupManagement_access_level_all_members);
|
||||
case ADMINISTRATOR : return context.getString(R.string.GroupManagement_access_level_only_admins);
|
||||
default : return context.getString(R.string.GroupManagement_access_level_unknown);
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.google.protobuf.ByteString;
|
||||
import org.signal.storageservice.protos.groups.GroupInviteLink;
|
||||
import org.signal.zkgroup.InvalidInputException;
|
||||
import org.signal.zkgroup.groups.GroupMasterKey;
|
||||
import org.thoughtcrime.securesms.util.Base64UrlSafe;
|
||||
import org.whispersystems.util.Base64UrlSafe;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
@@ -3,9 +3,12 @@ package org.thoughtcrime.securesms.groups.v2;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedGroup;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedGroupChange;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedMember;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedRequestingMember;
|
||||
import org.signal.zkgroup.InvalidInputException;
|
||||
import org.signal.zkgroup.profiles.ProfileKey;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
@@ -50,6 +53,10 @@ public final class ProfileKeySet {
|
||||
for (DecryptedMember member : change.getModifiedProfileKeysList()) {
|
||||
addMemberKey(member, editor);
|
||||
}
|
||||
|
||||
for (DecryptedRequestingMember member : change.getNewRequestingMembersList()) {
|
||||
addMemberKey(editor, member.getUuid(), member.getProfileKey());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +73,14 @@ public final class ProfileKeySet {
|
||||
}
|
||||
|
||||
private void addMemberKey(@NonNull DecryptedMember member, @Nullable UUID changeSource) {
|
||||
UUID memberUuid = UuidUtil.fromByteString(member.getUuid());
|
||||
addMemberKey(changeSource, member.getUuid(), member.getProfileKey());
|
||||
}
|
||||
|
||||
private void addMemberKey(@Nullable UUID changeSource,
|
||||
@NonNull ByteString memberUuidBytes,
|
||||
@NonNull ByteString profileKeyBytes)
|
||||
{
|
||||
UUID memberUuid = UuidUtil.fromByteString(memberUuidBytes);
|
||||
|
||||
if (UuidUtil.UNKNOWN_UUID.equals(memberUuid)) {
|
||||
Log.w(TAG, "Seen unknown member UUID");
|
||||
@@ -75,7 +89,7 @@ public final class ProfileKeySet {
|
||||
|
||||
ProfileKey profileKey;
|
||||
try {
|
||||
profileKey = new ProfileKey(member.getProfileKey().toByteArray());
|
||||
profileKey = new ProfileKey(profileKeyBytes.toByteArray());
|
||||
} catch (InvalidInputException e) {
|
||||
Log.w(TAG, "Bad profile key in group");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user