# HG changeset patch # User Waqas Hussain # Date 1243939984 -18000 # Node ID fa00d56a9fd32aa0c5c543634fb9486848e84631 # Parent 2abf85791f296d3170b839988b9cf07a120307d9 mod_presence: Handle all outbound presence stanzas diff -r 2abf85791f29 -r fa00d56a9fd3 plugins/mod_presence.lua --- a/plugins/mod_presence.lua Tue Jun 02 07:26:40 2009 +0500 +++ b/plugins/mod_presence.lua Tue Jun 02 15:53:04 2009 +0500 @@ -272,7 +272,7 @@ prosody.events.remove_handler(module:get_host().."/presence", presence_handler); end -module:hook("pre-presence/full", function(data) +local outbound_presence_handler = function(data) -- outbound presence to full JID recieved local origin, stanza = data.origin, data.stanza; @@ -292,4 +292,8 @@ origin.directed[to] = true; -- FIXME does it make more sense to add to_bare rather than to? end end -end); +end + +module:hook("pre-presence/full", outbound_presence_handler); +module:hook("pre-presence/bare", outbound_presence_handler); +module:hook("pre-presence/host", outbound_presence_handler);