mod_presence: Reflect the user's own presence back to them.
authorWaqas Hussain <waqas20@gmail.com>
Sun, 14 Feb 2010 23:15:37 +0000 (04:15 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sun, 14 Feb 2010 23:15:37 +0000 (04:15 +0500)
plugins/mod_presence.lua

index f6ea9e6b7b36cd91298b651e42ae07bfb43fff9b..a39d9c19cd87d2de3b5d0e5ccb09e0cc17d4ca5b 100644 (file)
@@ -63,6 +63,9 @@ local function recalc_resource_map(user)
 end
 
 function handle_normal_presence(origin, stanza, core_route_stanza)
+       if full_sessions[origin.full_jid] then -- if user is still connected
+               origin.send(stanza); -- reflect their presence back to them
+       end
        local roster = origin.roster;
        local node, host = origin.username, origin.host;
        local user = bare_sessions[node.."@"..host];