Comparison

mod_blocking/mod_blocking.lua @ 175:92a72435721a

mod_blocking: Fixed a nil global access.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 14 Jun 2010 01:04:58 +0500
parent 174:d40982d130f0
child 176:26bb69a57749
comparison
equal deleted inserted replaced
174:d40982d130f0 175:92a72435721a
110 elseif stanza.tags[1].name == "unblock" then 110 elseif stanza.tags[1].name == "unblock" then
111 remove_all_blocked_jids(username, host); 111 remove_all_blocked_jids(username, host);
112 session.send(st.reply(stanza)); 112 session.send(st.reply(stanza));
113 end 113 end
114 elseif stanza.attr.type == "get" and stanza.tags[1].name == "blocklist" then 114 elseif stanza.attr.type == "get" and stanza.tags[1].name == "blocklist" then
115 local reply = st.reply(stanza):tag("blocklist", { xmlns = xmlns_block }); 115 local reply = st.reply(stanza):tag("blocklist", { xmlns = xmlns_blocking });
116 local blocked_jids = get_blocked_jids(username, host); 116 local blocked_jids = get_blocked_jids(username, host);
117 for _, jid in ipairs(blocked_jids) do 117 for _, jid in ipairs(blocked_jids) do
118 reply:tag("item", { jid = jid }):up(); 118 reply:tag("item", { jid = jid }):up();
119 end 119 end
120 session.send(reply); 120 session.send(reply);