# HG changeset patch # User Waqas Hussain # Date 1265930550 -18000 # Node ID c3ea4d3f857fac0b989db83e5d61112c554b51d8 # Parent c9ed79940b2e79e4136dfbbfabe120930034ab31 mod_roster: Hook stream-features event using new events API. diff -r c9ed79940b2e -r c3ea4d3f857f plugins/mod_roster.lua --- 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)