Comparison

plugins/muc/muc.lib.lua @ 9766:f40b9649e929

MUC: Rename import to avoid name clash [luacheck]
author Kim Alvefur <zash@zash.se>
date Sun, 06 Jan 2019 12:20:57 +0100
parent 9761:8e83f90bf96b
child 9820:87a1742f928d
comparison
equal deleted inserted replaced
9765:5253555128ec 9766:f40b9649e929
21 local jid_resource = require "util.jid".resource; 21 local jid_resource = require "util.jid".resource;
22 local resourceprep = require "util.encodings".stringprep.resourceprep; 22 local resourceprep = require "util.encodings".stringprep.resourceprep;
23 local st = require "util.stanza"; 23 local st = require "util.stanza";
24 local base64 = require "util.encodings".base64; 24 local base64 = require "util.encodings".base64;
25 local md5 = require "util.hashes".md5; 25 local md5 = require "util.hashes".md5;
26 local id = require "util.id"; 26 local new_id = require "util.id".medium;
27 27
28 local log = module._log; 28 local log = module._log;
29 29
30 local occupant_lib = module:require "muc/occupant" 30 local occupant_lib = module:require "muc/occupant"
31 local muc_util = module:require "muc/util"; 31 local muc_util = module:require "muc/util";
1037 1037
1038 function room_mt:handle_groupchat_to_room(origin, stanza) 1038 function room_mt:handle_groupchat_to_room(origin, stanza)
1039 local from = stanza.attr.from; 1039 local from = stanza.attr.from;
1040 local occupant = self:get_occupant_by_real_jid(from); 1040 local occupant = self:get_occupant_by_real_jid(from);
1041 if not stanza.attr.id then 1041 if not stanza.attr.id then
1042 stanza.attr.id = id.medium() 1042 stanza.attr.id = new_id()
1043 end 1043 end
1044 if module:fire_event("muc-occupant-groupchat", { 1044 if module:fire_event("muc-occupant-groupchat", {
1045 room = self; origin = origin; stanza = stanza; from = from; occupant = occupant; 1045 room = self; origin = origin; stanza = stanza; from = from; occupant = occupant;
1046 }) then return true; end 1046 }) then return true; end
1047 stanza.attr.from = occupant.nick; 1047 stanza.attr.from = occupant.nick;