Diff

plugins/mod_lastactivity.lua @ 2025:dab1693f8a08

mod_lastactivity: Allow users to request their own last activity.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 21 Oct 2009 01:01:46 +0500
parent 2018:418c04834017
child 2026:97b17187b29d
line wrap: on
line diff
--- 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));