Warn about undelivered carbons to foreign servers
This commit is contained in:
parent
0a2c4e09d9
commit
75f0532193
|
@ -15,7 +15,7 @@ import (
|
||||||
goxmpp "gosrc.io/xmpp"
|
goxmpp "gosrc.io/xmpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version string = "1.5.0-dev"
|
var version string = "1.5.0"
|
||||||
var commit string
|
var commit string
|
||||||
|
|
||||||
var sm *goxmpp.StreamManager
|
var sm *goxmpp.StreamManager
|
||||||
|
|
|
@ -168,6 +168,15 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) {
|
||||||
|
|
||||||
if msg.Type == "error" {
|
if msg.Type == "error" {
|
||||||
log.Errorf("MESSAGE ERROR: %#v", p)
|
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…
Reference in a new issue