From 75f0532193440294f4bbf7cd687174b5e9a16249 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sun, 19 Mar 2023 18:12:06 -0400 Subject: Warn about undelivered carbons to foreign servers --- xmpp/handlers.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xmpp') 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) + } + } + } } } -- cgit v1.2.3