# HG changeset patch # User Waqas Hussain # Date 1285673777 -18000 # Node ID 711eb5bf94b4a6986b0d67c33281274c29c9bbef # Parent 72cb8b6536b92f77dc37cf23232aaa9093e539ff MUC: Make the room node be the default room name (thanks Zash). diff -r 72cb8b6536b9 -r 711eb5bf94b4 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Mon Sep 27 19:51:14 2010 +0500 +++ b/plugins/muc/mod_muc.lua Tue Sep 28 16:36:17 2010 +0500 @@ -87,7 +87,7 @@ local reply = st.iq({type='result', id=stanza.attr.id, from=muc_host, to=stanza.attr.from}):query("http://jabber.org/protocol/disco#items"); for jid, room in pairs(rooms) do if not room:is_hidden() then - reply:tag("item", {jid=jid, name=jid}):up(); + reply:tag("item", {jid=jid, name=room:get_name()}):up(); end end return reply; -- TODO cache disco reply diff -r 72cb8b6536b9 -r 711eb5bf94b4 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Mon Sep 27 19:51:14 2010 +0500 +++ b/plugins/muc/muc.lib.lua Tue Sep 28 16:36:17 2010 +0500 @@ -260,14 +260,14 @@ end function room_mt:set_name(name) - if name == "" or type(name) ~= "string" then name = nil; end + if name == "" or type(name) ~= "string" or name == (jid_split(self.jid)) then name = nil; end if self._data.name ~= name then self._data.name = name; if self.save then self:save(true); end end end function room_mt:get_name() - return self._data.name; + return self._data.name or jid_split(self.jid); end function room_mt:set_description(description) if description == "" or type(description) ~= "string" then description = nil; end