diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-09-09 19:14:12 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-09-09 19:14:12 +0500 |
commit | 079e6b32b4e7a432aae099a4f573aafb06f15971 (patch) | |
tree | 2359115a16e3994e027ddef12d801c62318bb778 /plugins/muc/muc.lib.lua | |
parent | afb7e49cbd10aabaf34629a407711310e0a2de07 (diff) | |
download | prosody-079e6b32b4e7a432aae099a4f573aafb06f15971.tar.gz prosody-079e6b32b4e7a432aae099a4f573aafb06f15971.zip |
MUC: Removed commented code.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 56 |
1 files changed, 0 insertions, 56 deletions
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]] |