mod_lastactivity: Allow users to request their own last activity.
authorWaqas Hussain <waqas20@gmail.com>
Wed, 21 Oct 2009 01:01:46 +0500
changeset 2025 dab1693f8a08
parent 2024 46a9c7c99476
child 2026 97b17187b29d
mod_lastactivity: Allow users to request their own last activity.
plugins/mod_lastactivity.lua
--- a/plugins/mod_lastactivity.lua	Tue Oct 20 18:12:46 2009 +0100
+++ b/plugins/mod_lastactivity.lua	Wed Oct 21 01:01:46 2009 +0500
@@ -29,7 +29,7 @@
 	local origin, stanza = event.origin, event.stanza;
 	if stanza.attr.type == "get" then
 		local username = jid_split(stanza.attr.to) or origin.username;
-		if is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
+		if not stanza.attr.to or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
 			local seconds, text = "0", "";
 			if map[username] then
 				seconds = tostring(os.difftime(os.time(), map[username].t));