Comparison

plugins/mod_pep.lua @ 1399:8879f8278762

mod_pep: Fixed detection of contact presence changes
author Waqas Hussain <waqas20@gmail.com>
date Wed, 24 Jun 2009 19:24:02 +0500
parent 1338:0bfc8d866479
child 1400:cbbb4f4fed68
comparison
equal deleted inserted replaced
1398:141fec125af0 1399:8879f8278762
39 core_route_stanza(session, stanza); 39 core_route_stanza(session, stanza);
40 end 40 end
41 end 41 end
42 end 42 end
43 43
44 module:hook("presence/bare", function(data) 44 module:hook("presence/bare", function(event)
45 -- inbound presence to bare JID recieved 45 -- inbound presence to bare JID recieved
46 local origin, stanza = data.origin, data.stanza; 46 local origin, stanza = event.origin, event.stanza;
47 47
48 local user = stanza.attr.to or (origin.username..'@'..origin.host); 48 local user = stanza.attr.to or (origin.username..'@'..origin.host);
49 local bare = jid_bare(stanza.attr.from); 49 local bare = jid_bare(stanza.attr.from);
50 local item = load_roster(jid_split(user))[bare]; 50 local item = load_roster(jid_split(user))[bare];
51 if not stanza.attr.to or (item and (item.subscription == 'from' or item.subscription == 'both')) then 51 if not stanza.attr.to or (item and (item.subscription == 'from' or item.subscription == 'both')) then