Software /
code /
prosody
Comparison
plugins/muc/password.lib.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 05 Nov 2020 22:31:25 +0100 |
parent | 10447:b5fd1637f15c |
child | 12027:5fb16f41f861 |
comparison
equal
deleted
inserted
replaced
11199:6c7c50a4de32 | 11200:bf8f2da84007 |
---|---|
48 local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc"); | 48 local password = muc_x:get_child_text("password", "http://jabber.org/protocol/muc"); |
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"):up(); | 53 local reply = st.error_reply(stanza, "auth", "not-authorized", nil, room.jid):up(); |
54 reply.tags[1].attr.code = "401"; | 54 reply.tags[1].attr.code = "401"; |
55 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); | 55 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); |
56 return true; | 56 return true; |
57 end | 57 end |
58 end, -20); | 58 end, -20); |