Return registration-required instead of not-authorized

This commit is contained in:
Bohdan Horbeshko 2023-09-28 16:30:28 -04:00
parent cdaaa75c96
commit 41503c7fd4

View file

@ -448,7 +448,7 @@ func handleMUCPresence(s xmpp.Sender, p stanza.Presence, mucExt stanza.MucPresen
session, ok := sessions[fromBare]
if !ok || !session.Session.MUC {
presenceReplySetError(reply, 401)
presenceReplySetError(reply, 407)
return
}
@ -790,9 +790,9 @@ func presenceReplySetError(reply *stanza.Presence, code int) {
case 400:
reply.Error.Type = stanza.ErrorTypeModify
reply.Error.Reason = "jid-malformed"
case 401:
case 407:
reply.Error.Type = stanza.ErrorTypeAuth
reply.Error.Reason = "not-authorized"
reply.Error.Reason = "registration-required"
case 404:
reply.Error.Type = stanza.ErrorTypeCancel
reply.Error.Reason = "item-not-found"