From ff46fe14dae76ff484780823a58a9fb1a2d3fd59 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+PascalPrecht@users.noreply.github.com> Date: Mon, 9 May 2022 13:16:14 +0200 Subject: [PATCH] Send archive messages to clients --- protocol/messenger_handler.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index 2908c403b99..d68658c9761 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -19,6 +19,8 @@ import ( "github.com/status-im/status-go/protocol/encryption/multidevice" "github.com/status-im/status-go/protocol/protobuf" v1protocol "github.com/status-im/status-go/protocol/v1" + localnotifications "github.com/status-im/status-go/services/local-notifications" + "github.com/status-im/status-go/signal" ) const ( @@ -728,12 +730,18 @@ func (m *Messenger) HandleHistoryArchiveMagnetlinkMessage(state *ReceivedMessage return } - _, err = m.handleRetrievedMessages(messagesToHandle, false) + response, err := m.handleRetrievedMessages(messagesToHandle, false) if err != nil { log.Println("failed to write history archive messages to database", err) m.logger.Debug("failed to write history archive messages to database", zap.Error(err)) } m.downloadHistoryArchiveTasksWaitGroup.Done() + if !response.IsEmpty() { + notifications := response.Notifications() + response.ClearNotifications() + signal.SendNewMessages(response) + localnotifications.PushMessages(notifications) + } }() return m.communitiesManager.UpdateMagnetlinkMessageClock(id, clock)