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,