also use xmpp JID as part of settings persistence #17

Merged
genofire merged 2 commits from karmanyaahm/unified-push-xmpp:smth into main 2021-09-17 18:09:47 +02:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 5e0ec90bf4 - Show all commits

View File

@ -178,7 +178,7 @@ func (s *XMPPService) selectGateway() {
if s.KeepGateway { if s.KeepGateway {
return return
} }
conns := s.store.GetUnequalSettings(s.gateway.String()) conns := s.store.GetUnequalSettings(s.gateway.String() + s.session.LocalAddr().Bare().String())
if len(conns) <= 0 { if len(conns) <= 0 {
return return
} }
@ -242,7 +242,7 @@ func (s *XMPPService) Register(appID, appToken string) (string, string, error) {
"appID": appID, "appID": appID,
"appToken": appToken, "appToken": appToken,
}) })
conn := s.store.NewConnection(appID, appToken, s.gateway.String()) conn := s.store.NewConnection(appID, appToken, s.gateway.String()+s.session.LocalAddr().Bare().String())
if conn == nil { if conn == nil {
errStr := "error to store public token" errStr := "error to store public token"
err := errors.New(errStr) err := errors.New(errStr)