get messenger from account service when local pairing (#3069)
This commit is contained in:
parent
04de916cba
commit
dc87d6bb0f
|
@ -1353,9 +1353,9 @@ func (b *GethStatusBackend) SignGroupMembership(content string) (string, error)
|
|||
func (b *GethStatusBackend) Messenger() *protocol.Messenger {
|
||||
node := b.StatusNode()
|
||||
if node != nil {
|
||||
wakuExtService := node.WakuExtService()
|
||||
if wakuExtService != nil {
|
||||
return wakuExtService.Messenger()
|
||||
accountService := node.AccountService()
|
||||
if accountService != nil {
|
||||
return accountService.GetMessenger()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -30,7 +30,7 @@ func NewSyncRawMessageHandler(backend *api.GethStatusBackend) *SyncRawMessageHan
|
|||
func (s *SyncRawMessageHandler) PrepareRawMessage(keyUID string) ([]byte, error) {
|
||||
messenger := s.backend.Messenger()
|
||||
if messenger == nil {
|
||||
return nil, fmt.Errorf("messenger is nil when handlePairingSyncDeviceSend")
|
||||
return nil, fmt.Errorf("messenger is nil when PrepareRawMessage")
|
||||
}
|
||||
|
||||
currentAccount, err := s.backend.GetActiveAccount()
|
||||
|
@ -112,6 +112,9 @@ func (s *SyncRawMessageHandler) HandleRawMessage(account *multiaccounts.Account,
|
|||
}
|
||||
|
||||
messenger := s.backend.Messenger()
|
||||
if messenger == nil {
|
||||
return fmt.Errorf("messenger is nil when HandleRawMessage")
|
||||
}
|
||||
return messenger.HandleSyncRawMessages(rawMessages)
|
||||
}
|
||||
|
||||
|
|
|
@ -78,3 +78,7 @@ func (s *Service) GetAccountsByKeyUID(keyUID string) ([]*accounts.Account, error
|
|||
func (s *Service) GetSettings() (settings.Settings, error) {
|
||||
return s.db.GetSettings()
|
||||
}
|
||||
|
||||
func (s *Service) GetMessenger() *protocol.Messenger {
|
||||
return s.messenger
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue