plugins/mod_roster.lua
changeset 2611 c3ea4d3f857f
parent 2227 1888368c58c5
child 2907 767864297afe
--- 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)