From 079e6b32b4e7a432aae099a4f573aafb06f15971 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 9 Sep 2009 19:14:12 +0500 Subject: MUC: Removed commented code. --- plugins/muc/muc.lib.lua | 56 ------------------------------------------------- 1 file changed, 56 deletions(-) (limited to 'plugins') diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index c63d579d..05135c8f 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -585,59 +585,3 @@ function _M.new_room(jid) end return _M; - ---[[function get_disco_info(stanza) - return st.iq({type='result', id=stanza.attr.id, from=muc_domain, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#info") - :tag("identity", {category='conference', type='text', name=muc_name}):up() - :tag("feature", {var="http://jabber.org/protocol/muc"}); -- TODO cache disco reply -end -function get_disco_items(stanza) - local reply = st.iq({type='result', id=stanza.attr.id, from=muc_domain, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); - for room in pairs(rooms_info:get()) do - reply:tag("item", {jid=room, name=rooms_info:get(room, "name")}):up(); - end - return reply; -- TODO cache disco reply -end]] - ---[[function handle_to_domain(origin, stanza) - local type = stanza.attr.type; - if type == "error" or type == "result" then return; end - if stanza.name == "iq" and type == "get" then - local xmlns = stanza.tags[1].attr.xmlns; - if xmlns == "http://jabber.org/protocol/disco#info" then - origin.send(get_disco_info(stanza)); - elseif xmlns == "http://jabber.org/protocol/disco#items" then - origin.send(get_disco_items(stanza)); - else - origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- TODO disco/etc - end - else - origin.send(st.error_reply(stanza, "cancel", "service-unavailable", "The muc server doesn't deal with messages and presence directed at it")); - end -end - -register_component(muc_domain, function(origin, stanza) - local to_node, to_host, to_resource = jid_split(stanza.attr.to); - if to_resource and not to_node then - if type == "error" or type == "result" then return; end - origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- host/resource - elseif to_resource then - handle_to_occupant(origin, stanza); - elseif to_node then - handle_to_room(origin, stanza) - else -- to the main muc domain - if type == "error" or type == "result" then return; end - handle_to_domain(origin, stanza); - end -end);]] - ---[[module.unload = function() - deregister_component(muc_domain); -end -module.save = function() - return {rooms = rooms.data; jid_nick = jid_nick.data; rooms_info = rooms_info.data; persist_list = persist_list}; -end -module.restore = function(data) - rooms.data, jid_nick.data, rooms_info.data, persist_list = - data.rooms or {}, data.jid_nick or {}, data.rooms_info or {}, data.persist_list or {}; -end]] -- cgit v1.2.3