mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Remove UUIDs from GV1 membership lists.
This commit is contained in:
@@ -3,6 +3,8 @@ package org.thoughtcrime.securesms.mms;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedMember;
|
||||
import org.signal.zkgroup.InvalidInputException;
|
||||
import org.signal.zkgroup.groups.GroupMasterKey;
|
||||
@@ -11,6 +13,7 @@ import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.util.Base64;
|
||||
import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
import org.whispersystems.signalservice.internal.push.SignalServiceProtos.GroupContext;
|
||||
import org.whispersystems.signalservice.internal.push.SignalServiceProtos.GroupContextV2;
|
||||
@@ -123,20 +126,13 @@ public final class MessageGroupContext {
|
||||
|
||||
@Override
|
||||
public @NonNull List<RecipientId> getMembersListExcludingSelf() {
|
||||
List<GroupContext.Member> membersList = groupContext.getMembersList();
|
||||
if (membersList.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
LinkedList<RecipientId> members = new LinkedList<>();
|
||||
RecipientId selfId = Recipient.self().getId();
|
||||
|
||||
for (GroupContext.Member member : membersList) {
|
||||
RecipientId recipient = RecipientId.from(UuidUtil.parseOrNull(member.getUuid()), member.getE164());
|
||||
if (!Recipient.self().getId().equals(recipient)) {
|
||||
members.add(recipient);
|
||||
}
|
||||
}
|
||||
return members;
|
||||
}
|
||||
return Stream.of(groupContext.getMembersE164List())
|
||||
.map(e164 -> new SignalServiceAddress(null, e164))
|
||||
.map(RecipientId::from)
|
||||
.filterNot(selfId::equals)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user