Skip to content

Commit

Permalink
Send archive messages to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-r4bbit committed May 9, 2022
1 parent add0e6d commit ff46fe1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion protocol/messenger_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ff46fe1

Please sign in to comment.