Software /
code /
prosody-modules
Diff
mod_idlecompat/mod_idlecompat.lua @ 2164:4b58e35a72e0
mod_idlecompat: Reference the correct XEP (256, not 12) and drop a redundant check
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 16 Apr 2016 12:48:00 +0100 |
parent | 1260:4e14ad802d58 |
line wrap: on
line diff
--- a/mod_idlecompat/mod_idlecompat.lua Fri Apr 15 16:59:27 2016 +0000 +++ b/mod_idlecompat/mod_idlecompat.lua Sat Apr 16 12:48:00 2016 +0100 @@ -1,6 +1,6 @@ -- Last User Interaction in Presence via Last Activity compatibility module -- http://xmpp.org/extensions/xep-0319.html --- http://xmpp.org/extensions/xep-0012.html +-- http://xmpp.org/extensions/xep-0256.html -- Copyright (C) 2014 Tobias Markmann -- -- This file is MIT/X11 licensed. @@ -11,7 +11,7 @@ local function on_presence(event) local stanza = event.stanza; - local last_activity = stanza.name == "presence" and stanza:get_child("query", "jabber:iq:last") or false; + local last_activity = stanza:get_child("query", "jabber:iq:last"); local has_idle = stanza:get_child("idle", "urn:xmpp:idle:1"); if last_activity and not has_idle then module:log("debug", "Adding XEP-0319 tag from Last Activity."); @@ -28,4 +28,4 @@ -- outgoing module:hook("pre-presence/bare", on_presence, 900); module:hook("pre-presence/full", on_presence, 900); -module:hook("pre-presence/host", on_presence, 900); \ No newline at end of file +module:hook("pre-presence/host", on_presence, 900);