Changeset

2611:c3ea4d3f857f

mod_roster: Hook stream-features event using new events API.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 12 Feb 2010 04:22:30 +0500
parents 2610:c9ed79940b2e
children 2612:475552b04151
files plugins/mod_roster.lua
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_roster.lua	Fri Feb 12 04:22:01 2010 +0500
+++ b/plugins/mod_roster.lua	Fri Feb 12 04:22:30 2010 +0500
@@ -23,12 +23,12 @@
 module:add_feature("jabber:iq:roster");
 
 local rosterver_stream_feature = st.stanza("ver", {xmlns="urn:xmpp:features:rosterver"}):tag("optional"):up();
-module:add_event_hook("stream-features", 
-		function (session, features)
-			if session.username then
-				features:add_child(rosterver_stream_feature);
-			end
-		end);
+module:hook("stream-features", function(event)
+	local origin, features = event.origin, event.features;
+	if origin.username then
+		features:add_child(rosterver_stream_feature);
+	end
+end);
 
 module:add_iq_handler("c2s", "jabber:iq:roster", 
 		function (session, stanza)