diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2020-01-10 16:02:25 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2020-01-10 16:02:25 +0300 |
commit | fd1fd560bc7dedd33a4e5232dfbcd9e0f7d88c92 (patch) | |
tree | 03256d85335fa1722a4719c188d86cba7433f122 /xmpp/handlers.go | |
parent | 23f2a85301f2ee5af867fa774a406cf308733714 (diff) |
Try to resume connection and resend a stanza on failure
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index 8778423..2e44411 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -126,7 +126,13 @@ func handleSubscription(s xmpp.Sender, p stanza.Presence) { Type: "subscribed", }} - _ = s.Send(reply) + component, ok := s.(*xmpp.Component) + if !ok { + log.Error("Not a component") + return + } + + _ = gateway.ResumableSend(component, reply) } func handlePresence(s xmpp.Sender, p stanza.Presence) { @@ -262,5 +268,11 @@ func handleGetVcardTempIq(s xmpp.Sender, iq stanza.IQ) { } log.Debugf("%#v", answer) - _ = s.Send(answer) + component, ok := s.(*xmpp.Component) + if !ok { + log.Error("Not a component") + return + } + + _ = gateway.ResumableSend(component, answer) } |