Comparison

plugins/mod_lastactivity.lua @ 2029:d2363643a5c0

mod_lastactivity: Gave a positive priority to the presence event hook.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 21 Oct 2009 11:29:43 +0500
parent 2026:97b17187b29d
child 2923:b7049746bd29
comparison
equal deleted inserted replaced
2028:4f33100195a0 2029:d2363643a5c0
21 local t = os.time(); 21 local t = os.time();
22 local s = stanza:child_with_name("status"); 22 local s = stanza:child_with_name("status");
23 s = s and #s.tags == 0 and s[1] or ""; 23 s = s and #s.tags == 0 and s[1] or "";
24 map[event.origin.username] = {s = s, t = t}; 24 map[event.origin.username] = {s = s, t = t};
25 end 25 end
26 end); 26 end, 10);
27 27
28 module:hook("iq/bare/jabber:iq:last:query", function(event) 28 module:hook("iq/bare/jabber:iq:last:query", function(event)
29 local origin, stanza = event.origin, event.stanza; 29 local origin, stanza = event.origin, event.stanza;
30 if stanza.attr.type == "get" then 30 if stanza.attr.type == "get" then
31 local username = jid_split(stanza.attr.to) or origin.username; 31 local username = jid_split(stanza.attr.to) or origin.username;