Mercurial > prosody-hg
comparison plugins/muc/password.lib.lua @ 12027:5fb16f41f861
MUC: Remove remaining deprecated numeric error codes
The numeric error codes seems to have been removed from the examples in
XEP-0045 version 1.24, and were deprecated even by RFC 3920 in 2004,
only allowed for backwards compatibility.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 08 Dec 2021 21:02:14 +0100 |
| parents | b5fd1637f15c |
| children | 631b2afa7bc1 |
comparison
equal
deleted
inserted
replaced
| 12026:f3b09b8445b3 | 12027:5fb16f41f861 |
|---|---|
| 49 if not password or password == "" then password = nil; end | 49 if not password or password == "" then password = nil; end |
| 50 if get_password(room) ~= password then | 50 if get_password(room) ~= password then |
| 51 local from, to = stanza.attr.from, stanza.attr.to; | 51 local from, to = stanza.attr.from, stanza.attr.to; |
| 52 module:log("debug", "%s couldn't join due to invalid password: %s", from, to); | 52 module:log("debug", "%s couldn't join due to invalid password: %s", from, to); |
| 53 local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up(); | 53 local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up(); |
| 54 reply.tags[1].attr.code = "401"; | |
| 55 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); | 54 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
| 56 return true; | 55 return true; |
| 57 end | 56 end |
| 58 end, -20); | 57 end, -20); |
| 59 | 58 |
