diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-20 01:12:06 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-20 01:12:06 +0300 |
commit | 75f0532193440294f4bbf7cd687174b5e9a16249 (patch) | |
tree | 176358c5bc736a13c45c953bcbcd52a35964d659 | |
parent | 0a2c4e09d9179108208461a58990f3397dad5a6c (diff) |
Warn about undelivered carbons to foreign serversv1.5.0
-rw-r--r-- | telegabber.go | 2 | ||||
-rw-r--r-- | xmpp/handlers.go | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/telegabber.go b/telegabber.go index 0554cb9..72353bb 100644 --- a/telegabber.go +++ b/telegabber.go @@ -15,7 +15,7 @@ import ( goxmpp "gosrc.io/xmpp" ) -var version string = "1.5.0-dev" +var version string = "1.5.0" var commit string var sm *goxmpp.StreamManager diff --git a/xmpp/handlers.go b/xmpp/handlers.go index 2bdbaef..db2b6ea 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -168,6 +168,15 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) { if msg.Type == "error" { log.Errorf("MESSAGE ERROR: %#v", p) + + if msg.XMLName.Space == "jabber:component:accept" && msg.Error.Code == 401 { + suffix := "@" + msg.From + for bare := range sessions { + if strings.HasSuffix(bare, suffix) { + gateway.SendServiceMessage(bare, "Your server \"" + msg.From + "\" does not allow to send carbons", component) + } + } + } } } |