plugins/mod_muc.lua

changeset 828
97ea39b7bf90
parent 827
e74045238ee3
child 830
c0554caf90e6
equal deleted inserted replaced
827:e74045238ee3 828:97ea39b7bf90
225 local from, to = stanza.attr.from, stanza.attr.to; 225 local from, to = stanza.attr.from, stanza.attr.to;
226 local room = jid_bare(to); 226 local room = jid_bare(to);
227 local current_nick = jid_nick:get(from, room); 227 local current_nick = jid_nick:get(from, room);
228 local type = stanza.attr.type; 228 local type = stanza.attr.type;
229 log("debug", "room: %s, current_nick: %s, stanza: %s", room or "nil", current_nick or "nil", stanza:top_tag()); 229 log("debug", "room: %s, current_nick: %s, stanza: %s", room or "nil", current_nick or "nil", stanza:top_tag());
230 if (select(2, jid_split(from)) == muc_domain) error("Presence from the MUC itself!!!"); 230 if (select(2, jid_split(from)) == muc_domain) then error("Presence from the MUC itself!!!"); end
231 if stanza.name == "presence" then 231 if stanza.name == "presence" then
232 local pr = get_filtered_presence(stanza); 232 local pr = get_filtered_presence(stanza);
233 pr.attr.from = current_nick; 233 pr.attr.from = current_nick;
234 if type == "error" then -- error, kick em out! 234 if type == "error" then -- error, kick em out!
235 if current_nick then 235 if current_nick then

mercurial