Comparison

plugins/mod_roster.lua @ 1133:b293d7dc6a45

mod_roster: Advertize roster versioning support
author Waqas Hussain <waqas20@gmail.com>
date Fri, 08 May 2009 01:04:51 +0500
parent 928:92288c13d7bc
child 1198:545c81364939
comparison
equal deleted inserted replaced
1132:3a63efe285c2 1133:b293d7dc6a45
20 local rm_add_to_roster = require "core.rostermanager".add_to_roster; 20 local rm_add_to_roster = require "core.rostermanager".add_to_roster;
21 local rm_roster_push = require "core.rostermanager".roster_push; 21 local rm_roster_push = require "core.rostermanager".roster_push;
22 local core_route_stanza = core_route_stanza; 22 local core_route_stanza = core_route_stanza;
23 23
24 module:add_feature("jabber:iq:roster"); 24 module:add_feature("jabber:iq:roster");
25
26 local rosterver_stream_feature = st.stanza("ver", {xmlns="urn:xmpp:features:rosterver"}):tag("optional"):up();
27 module:add_event_hook("stream-features",
28 function (session, features)
29 if session.username then
30 features:add_child(rosterver_stream_feature);
31 end
32 end);
25 33
26 module:add_iq_handler("c2s", "jabber:iq:roster", 34 module:add_iq_handler("c2s", "jabber:iq:roster",
27 function (session, stanza) 35 function (session, stanza)
28 if stanza.tags[1].name == "query" then 36 if stanza.tags[1].name == "query" then
29 if stanza.attr.type == "get" then 37 if stanza.attr.type == "get" then