Warn about undelivered carbons to foreign servers

calls v1.5.0
Bohdan Horbeshko 3 months ago
parent 0a2c4e09d9
commit 75f0532193

@ -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

@ -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)
}
}
}
}
}

Loading…
Cancel
Save