Comparison

plugins/muc/muc.lib.lua @ 7366:eb3928903009

MUC: Wrap "support" for the groupchat 1.0 join protocol in a config option to allow disabling
author Kim Alvefur <zash@zash.se>
date Mon, 18 Apr 2016 19:20:51 +0200
parent 7364:9ea3094b1fca
child 7367:2aef5e8b69e9
comparison
equal deleted inserted replaced
7365:2d502878b784 7366:eb3928903009
353 self:publicise_occupant_status(occupant, x); 353 self:publicise_occupant_status(occupant, x);
354 if occupant.jid == real_jid then -- Was last session 354 if occupant.jid == real_jid then -- Was last session
355 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;}); 355 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;});
356 end 356 end
357 return true; 357 return true;
358 end
359
360 if not module:get_option_boolean("muc_compat_create", true) then
361 module:hook("muc-room-pre-create", function(event)
362 local origin, stanza = event.origin, event.stanza;
363 if not stanza:get_child("x", "http://jabber.org/protocol/muc") then
364 origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
365 return true;
366 end
367 end, -1);
358 end 368 end
359 369
360 -- Give the room creator owner affiliation 370 -- Give the room creator owner affiliation
361 module:hook("muc-room-pre-create", function(event) 371 module:hook("muc-room-pre-create", function(event)
362 event.room:set_affiliation(true, jid_bare(event.stanza.attr.from), "owner"); 372 event.room:set_affiliation(true, jid_bare(event.stanza.attr.from), "owner");