Comparison

plugins/muc/muc.lib.lua @ 7346:4ea5ce5efff8

MUC: Spread event tables over multiple lines
author Kim Alvefur <zash@zash.se>
date Fri, 08 Apr 2016 17:53:49 +0200
parent 7270:df22e314946c
child 7347:795a95258292
comparison
equal deleted inserted replaced
7343:1da5a710848d 7346:4ea5ce5efff8
489 end 489 end
490 self:save_occupant(orig_occupant); 490 self:save_occupant(orig_occupant);
491 self:publicise_occupant_status(orig_occupant, orig_x, dest_nick); 491 self:publicise_occupant_status(orig_occupant, orig_x, dest_nick);
492 492
493 if is_last_orig_session then 493 if is_last_orig_session then
494 module:fire_event("muc-occupant-left", {room = self; nick = orig_occupant.nick; occupant = orig_occupant;}); 494 module:fire_event("muc-occupant-left", {
495 room = self;
496 nick = orig_occupant.nick;
497 occupant = orig_occupant;
498 });
495 end 499 end
496 end 500 end
497 501
498 if dest_occupant ~= nil then 502 if dest_occupant ~= nil then
499 dest_occupant:set_session(real_jid, stanza); 503 dest_occupant:set_session(real_jid, stanza);
527 self:route_stanza(pr); 531 self:route_stanza(pr);
528 end 532 end
529 533
530 if orig_occupant == nil then 534 if orig_occupant == nil then
531 if is_first_dest_session then 535 if is_first_dest_session then
532 module:fire_event("muc-occupant-joined", {room = self; nick = dest_occupant.nick; occupant = dest_occupant;}); 536 module:fire_event("muc-occupant-joined", {
537 room = self;
538 nick = dest_occupant.nick;
539 occupant = dest_occupant;
540 });
533 end 541 end
534 module:fire_event("muc-occupant-session-new", {room = self; nick = dest_occupant.nick; occupant = dest_occupant; stanza = stanza; jid = real_jid;}); 542 module:fire_event("muc-occupant-session-new", {
543 room = self;
544 nick = dest_occupant.nick;
545 occupant = dest_occupant;
546 stanza = stanza;
547 origin = origin;
548 jid = real_jid;
549 });
535 end 550 end
536 end 551 end
537 elseif type ~= 'result' then -- bad type 552 elseif type ~= 'result' then -- bad type
538 if type ~= 'visible' and type ~= 'invisible' then -- COMPAT ejabberd can broadcast or forward XEP-0018 presences 553 if type ~= 'visible' and type ~= 'invisible' then -- COMPAT ejabberd can broadcast or forward XEP-0018 presences
539 origin.send(st.error_reply(stanza, "modify", "bad-request")); -- FIXME correct error? 554 origin.send(st.error_reply(stanza, "modify", "bad-request")); -- FIXME correct error?