GV2 group context proto.

This commit is contained in:
Alan Evans
2020-03-27 15:12:10 -03:00
committed by Greyson Parrelli
parent 20d1a93b09
commit 640c82d517
15 changed files with 351 additions and 172 deletions

View File

@@ -8,9 +8,10 @@ import org.thoughtcrime.securesms.contactshare.Contact;
import org.thoughtcrime.securesms.groups.GroupId;
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.util.GroupUtil;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
import org.whispersystems.signalservice.api.messages.SignalServiceGroupContext;
import java.util.Collections;
import java.util.LinkedList;
@@ -68,7 +69,7 @@ public class IncomingMediaMessage {
boolean viewOnce,
boolean unidentified,
Optional<String> body,
Optional<SignalServiceGroup> group,
Optional<SignalServiceGroupContext> group,
Optional<List<SignalServiceAttachment>> attachments,
Optional<QuoteModel> quote,
Optional<List<Contact>> sharedContacts,
@@ -86,7 +87,7 @@ public class IncomingMediaMessage {
this.quote = quote.orNull();
this.unidentified = unidentified;
if (group.isPresent()) this.groupId = GroupId.v1(group.get().getGroupId());
if (group.isPresent()) this.groupId = GroupUtil.idFromGroupContext(group.get());
else this.groupId = null;
this.attachments.addAll(PointerAttachment.forPointers(attachments));