Comparison

mod_track_muc_joins/mod_track_muc_joins.lua @ 2274:43e647b8dd9f

mod_track_muc_joins: Fix saving the room nick (was using the room node)
author Kim Alvefur <zash@zash.se>
date Thu, 18 Aug 2016 20:39:14 +0200
parent 2264:463e43dc0c4d
child 2302:12249570352f
comparison
equal deleted inserted replaced
2273:677fc0203da0 2274:43e647b8dd9f
11 local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc#user"); 11 local muc_x = stanza:get_child("x", "http://jabber.org/protocol/muc#user");
12 if not muc_x then return end -- Not MUC related 12 if not muc_x then return end -- Not MUC related
13 13
14 local from_jid = stanza.attr.from; 14 local from_jid = stanza.attr.from;
15 local room = jid_bare(from_jid); 15 local room = jid_bare(from_jid);
16 local nick = jid_split(from_jid); 16 local _,_,nick = jid_split(from_jid);
17 local joined = stanza.attr.type; 17 local joined = stanza.attr.type;
18 if joined == nil then 18 if joined == nil then
19 joined = nick; 19 joined = nick;
20 elseif joined == "unavailable" then 20 elseif joined == "unavailable" then
21 joined = nil; 21 joined = nil;