Comparison

plugins/muc/muc.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
parent 12026:f3b09b8445b3
child 12029:631b2afa7bc1
comparison
equal deleted inserted replaced
12026:f3b09b8445b3 12027:5fb16f41f861
447 module:hook("muc-occupant-pre-join", function(event) 447 module:hook("muc-occupant-pre-join", function(event)
448 local room, stanza = event.room, event.stanza; 448 local room, stanza = event.room, event.stanza;
449 local affiliation = room:get_affiliation(stanza.attr.from); 449 local affiliation = room:get_affiliation(stanza.attr.from);
450 if affiliation == "outcast" then 450 if affiliation == "outcast" then
451 local reply = st.error_reply(stanza, "auth", "forbidden", nil, room.jid):up(); 451 local reply = st.error_reply(stanza, "auth", "forbidden", nil, room.jid):up();
452 reply.tags[1].attr.code = "403";
453 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); 452 event.origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
454 return true; 453 return true;
455 end 454 end
456 end, -10); 455 end, -10);
457 456
690 if dest_occupant ~= nil and not is_first_dest_session 689 if dest_occupant ~= nil and not is_first_dest_session
691 and bare_jid ~= jid_bare(dest_occupant.bare_jid) then 690 and bare_jid ~= jid_bare(dest_occupant.bare_jid) then
692 -- new nick or has different bare real jid 691 -- new nick or has different bare real jid
693 log("debug", "%s couldn't join due to nick conflict: %s", real_jid, dest_occupant.nick); 692 log("debug", "%s couldn't join due to nick conflict: %s", real_jid, dest_occupant.nick);
694 local reply = st.error_reply(stanza, "cancel", "conflict", nil, self.jid):up(); 693 local reply = st.error_reply(stanza, "cancel", "conflict", nil, self.jid):up();
695 reply.tags[1].attr.code = "409";
696 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"})); 694 origin.send(reply:tag("x", {xmlns = "http://jabber.org/protocol/muc"}));
697 return true; 695 return true;
698 end 696 end
699 697
700 -- Send presence stanza about original occupant 698 -- Send presence stanza about original occupant