From 6e6c5d9a1939d988b637086255e3b8c30d48b87f Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Tue, 3 Sep 2024 15:18:52 +1000 Subject: [PATCH] show control message on main device when accepting message request --- .../Conversations/ConversationVC+Interaction.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index c529de74b..41a6b0717 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -2641,13 +2641,24 @@ extension ConversationVC { // messageRequestResponse back to the sender (this allows the sender to know that // they have been approved and can now use this contact in closed groups) if !isNewThread { + let interaction = try? Interaction( + threadId: threadId, + threadVariant: threadVariant, + authorId: getUserHexEncodedPublicKey(db), + variant: .infoMessageRequestAccepted, + body: "messageRequestYouHaveAccepted" + .put(key: "name", value: self.viewModel.threadData.displayName) + .localized(), + timestampMs: timestampMs + ).inserted(db) + try MessageSender.send( db, message: MessageRequestResponse( isApproved: true, sentTimestampMs: UInt64(timestampMs) ), - interactionId: nil, + interactionId: interaction?.id, threadId: threadId, threadVariant: threadVariant, using: dependencies