diff --git a/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceDataMessage.java b/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceDataMessage.java index 3458a53916..50a2961a8b 100644 --- a/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceDataMessage.java +++ b/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceDataMessage.java @@ -159,7 +159,21 @@ public class SignalServiceDataMessage { public boolean isGroupV2Update() { return isGroupV2Message() && - !body.isPresent(); + group.get().getGroupV2().get().hasSignedGroupChange() && + !hasRenderableContent(); + } + + /** Contains some user data that affects the conversation */ + public boolean hasRenderableContent() { + return attachments.isPresent() || + body.isPresent() || + quote.isPresent() || + contacts.isPresent() || + previews.isPresent() || + mentions.isPresent() || + sticker.isPresent() || + reaction.isPresent() || + remoteDelete.isPresent(); } public int getExpiresInSeconds() { diff --git a/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceGroupV2.java b/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceGroupV2.java index 1cefa2d3ce..a4789a8d07 100644 --- a/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceGroupV2.java +++ b/libsignal/service/src/main/java/org/whispersystems/signalservice/api/messages/SignalServiceGroupV2.java @@ -55,6 +55,10 @@ public final class SignalServiceGroupV2 { return signedGroupChange; } + public boolean hasSignedGroupChange() { + return signedGroupChange != null && signedGroupChange.length > 0; + } + public static Builder newBuilder(GroupMasterKey masterKey) { return new Builder(masterKey); }