mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +00:00
Return 405 for non-existent room JIDs as this should be considered a room creation attempt
This commit is contained in:
parent
746a537cb9
commit
174037e63f
1 changed files with 4 additions and 4 deletions
|
|
@ -561,7 +561,7 @@ func handleMUCPresence(s xmpp.Sender, p stanza.Presence, mucExt stanza.MucPresen
|
||||||
|
|
||||||
chatId, ok, toIsGroup := toToID(toBare)
|
chatId, ok, toIsGroup := toToID(toBare)
|
||||||
if !ok || !toIsGroup {
|
if !ok || !toIsGroup {
|
||||||
presenceReplySetError(reply, 404)
|
presenceReplySetError(reply, 405)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -579,7 +579,7 @@ func handleMUCPresence(s xmpp.Sender, p stanza.Presence, mucExt stanza.MucPresen
|
||||||
|
|
||||||
chat, _, err := session.GetContactByID(chatId, nil)
|
chat, _, err := session.GetContactByID(chatId, nil)
|
||||||
if err != nil || !session.IsGroup(chat) {
|
if err != nil || !session.IsGroup(chat) {
|
||||||
presenceReplySetError(reply, 404)
|
presenceReplySetError(reply, 405)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1862,9 +1862,9 @@ func presenceReplySetError(reply *stanza.Presence, code int) {
|
||||||
case 407:
|
case 407:
|
||||||
reply.Error.Type = stanza.ErrorTypeAuth
|
reply.Error.Type = stanza.ErrorTypeAuth
|
||||||
reply.Error.Reason = "registration-required"
|
reply.Error.Reason = "registration-required"
|
||||||
case 404:
|
case 405:
|
||||||
reply.Error.Type = stanza.ErrorTypeCancel
|
reply.Error.Type = stanza.ErrorTypeCancel
|
||||||
reply.Error.Reason = "item-not-found"
|
reply.Error.Reason = "not-allowed"
|
||||||
default:
|
default:
|
||||||
log.Error("Unknown error code, falling back with empty reason")
|
log.Error("Unknown error code, falling back with empty reason")
|
||||||
reply.Error.Type = stanza.ErrorTypeCancel
|
reply.Error.Type = stanza.ErrorTypeCancel
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue