aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-02-12 04:22:30 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-02-12 04:22:30 +0500
commit025cbd545c519e9c46e74f05bf3d58d30d6d403d (patch)
tree5b6827873001fcfd7386ae99e01e9a9cba312a89
parentafea5e0f463ee036646e7aef9c217e7c271a4d40 (diff)
downloadprosody-025cbd545c519e9c46e74f05bf3d58d30d6d403d.tar.gz
prosody-025cbd545c519e9c46e74f05bf3d58d30d6d403d.zip
mod_roster: Hook stream-features event using new events API.
-rw-r--r--plugins/mod_roster.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua
index 52c61a26..4362dca2 100644
--- a/plugins/mod_roster.lua
+++ b/plugins/mod_roster.lua
@@ -23,12 +23,12 @@ local core_post_stanza = core_post_stanza;
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)