Fix desktop sync with body-less messages.

master
Alan Evans 2020-09-28 11:48:09 -03:00
parent 222ba6ee53
commit caf8bb39d8
2 changed files with 19 additions and 1 deletions

View File

@ -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() {

View File

@ -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);
}