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 stanza.name == "presence" then |
231 if stanza.name == "presence" then |
231 local pr = get_filtered_presence(stanza); |
232 local pr = get_filtered_presence(stanza); |
232 pr.attr.from = current_nick; |
233 pr.attr.from = current_nick; |
233 if type == "error" then -- error, kick em out! |
234 if type == "error" then -- error, kick em out! |
234 if current_nick then |
235 if current_nick then |