Changeset

1279:fa00d56a9fd3

mod_presence: Handle all outbound presence stanzas
author Waqas Hussain <waqas20@gmail.com>
date Tue, 02 Jun 2009 15:53:04 +0500
parents 1278:2abf85791f29
children 1280:e360fef8882b
files plugins/mod_presence.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);