diff options
author | Waqas Hussain <waqas20@gmail.com> | 2008-10-22 21:20:07 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2008-10-22 21:20:07 +0500 |
commit | 9595202d474b7c2dd6654603cc81818b53682e87 (patch) | |
tree | 8f73772ec30edd69841acfdb487ed78397c02310 /plugins | |
parent | 2a2956ef53942cb20ea53d0216dc6e9af6185e5c (diff) | |
download | prosody-9595202d474b7c2dd6654603cc81818b53682e87.tar.gz prosody-9595202d474b7c2dd6654603cc81818b53682e87.zip |
Fixed: Roster support
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_roster.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua index f32efaa8..8e2f6bbb 100644 --- a/plugins/mod_roster.lua +++ b/plugins/mod_roster.lua @@ -6,6 +6,7 @@ local jid_split = require "util.jid".split; local t_concat = table.concat; local rm_remove_from_roster = require "core.rostermanager".remove_from_roster; +local rm_add_to_roster = require "core.rostermanager".add_to_roster; local rm_roster_push = require "core.rostermanager".roster_push; add_iq_handler("c2s", "jabber:iq:roster", @@ -15,15 +16,14 @@ add_iq_handler("c2s", "jabber:iq:roster", local roster = st.reply(stanza) :query("jabber:iq:roster"); for jid in pairs(session.roster) do - local item = st.stanza("item", { + roster:tag("item", { jid = jid, subscription = session.roster[jid].subscription, name = session.roster[jid].name, }); for group in pairs(session.roster[jid].groups) do - item:tag("group"):text(group):up(); + roster:tag("group"):text(group):up(); end - roster:add_child(item); end send(session, roster); return true; @@ -52,7 +52,7 @@ add_iq_handler("c2s", "jabber:iq:roster", local r_item = {name = item.attr.name, groups = {}}; if r_item.name == "" then r_item.name = nil; end if session.roster[item.attr.jid] then - r_item.subscription = session.roster[item.attr.jid]; + r_item.subscription = session.roster[item.attr.jid].subscription; else r_item.subscription = "none"; end |