From 45e1f6720d25611f6807b74791d8df290f659825 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Tue, 25 Feb 2025 10:44:11 +1100 Subject: [PATCH] [SES-3395] - Fix group notification issue (#973) --- .../securesms/groups/GroupManagerV2Impl.kt | 14 +++++++------- .../sending_receiving/notifications/Models.kt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt b/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt index 17ddfd1c3e..dc1ea686f5 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/GroupManagerV2Impl.kt @@ -276,11 +276,6 @@ class GroupManagerV2Impl @Inject constructor( subAccountTokens = subAccountTokens ) - // Send a group update message to the group telling members someone has been invited - if (!isReinvite) { - sendGroupUpdateForAddingMembers(group, adminKey, newMembers) - } - // Call the API try { val swarmNode = SnodeAPI.getSingleTargetSnode(group.hexString).await() @@ -310,6 +305,11 @@ class GroupManagerV2Impl @Inject constructor( groupName = groupName, underlying = e ) + } finally { + // Send a group update message to the group telling members someone has been invited + if (!isReinvite) { + sendGroupUpdateForAddingMembers(group, adminKey, newMembers) + } } // Send the invitation message to the new members @@ -346,9 +346,9 @@ class GroupManagerV2Impl @Inject constructor( .build() ).apply { this.sentTimestamp = timestamp } - MessageSender.send(updatedMessage, Address.fromSerialized(group.hexString)) - storage.insertGroupInfoChange(updatedMessage, group) + + MessageSender.send(updatedMessage, Address.fromSerialized(group.hexString)) } override suspend fun removeMembers( diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/notifications/Models.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/notifications/Models.kt index 14a68faec1..67ad8d0553 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/notifications/Models.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/notifications/Models.kt @@ -94,7 +94,7 @@ data class PushNotificationMetadata( /** The swarm namespace in which this message arrived. */ @SerialName("n") - val namespace: Int, + val namespace: Int?, @SerialName("t") val timestampSeconds: Long,