Fix unable to verify signed group change warning.

This commit is contained in:
Cody Henthorne
2023-04-21 12:36:52 -04:00
parent 8baf07a11c
commit f14bce9849
2 changed files with 4 additions and 3 deletions

View File

@@ -808,7 +808,7 @@ final class GroupManagerV2 {
} }
private DecryptedGroupChange getDecryptedGroupChange(@Nullable byte[] signedGroupChange) { private DecryptedGroupChange getDecryptedGroupChange(@Nullable byte[] signedGroupChange) {
if (signedGroupChange != null) { if (signedGroupChange != null && signedGroupChange.length > 0) {
GroupsV2Operations.GroupOperations groupOperations = groupsV2Operations.forGroup(GroupSecretParams.deriveFromMasterKey(groupMasterKey)); GroupsV2Operations.GroupOperations groupOperations = groupsV2Operations.forGroup(GroupSecretParams.deriveFromMasterKey(groupMasterKey));
try { try {

View File

@@ -253,8 +253,9 @@ open class MessageContentProcessorV2(private val context: Context) {
groupV2: SignalServiceProtos.GroupContextV2 groupV2: SignalServiceProtos.GroupContextV2
): Boolean { ): Boolean {
return try { return try {
val updatedTimestamp = if (groupV2.hasSignedGroupChange) timestamp else timestamp - 1 val signedGroupChange: ByteArray? = if (groupV2.hasSignedGroupChange) groupV2.signedGroupChange else null
GroupManager.updateGroupFromServer(context, groupV2.groupMasterKey, groupV2.revision, updatedTimestamp, groupV2.signedGroupChange) val updatedTimestamp = if (signedGroupChange != null) timestamp else timestamp - 1
GroupManager.updateGroupFromServer(context, groupV2.groupMasterKey, groupV2.revision, updatedTimestamp, signedGroupChange)
true true
} catch (e: GroupNotAMemberException) { } catch (e: GroupNotAMemberException) {
warn(timestamp, "Ignoring message for a group we're not in") warn(timestamp, "Ignoring message for a group we're not in")