Comparison

plugins/muc/muc.lib.lua @ 3510:711eb5bf94b4

MUC: Make the room node be the default room name (thanks Zash).
author Waqas Hussain <waqas20@gmail.com>
date Tue, 28 Sep 2010 16:36:17 +0500
parent 3509:72cb8b6536b9
child 3516:de54a7ab7e6e
comparison
equal deleted inserted replaced
3509:72cb8b6536b9 3510:711eb5bf94b4
258 return st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to}) 258 return st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to})
259 :tag('status'):text(error_message); 259 :tag('status'):text(error_message);
260 end 260 end
261 261
262 function room_mt:set_name(name) 262 function room_mt:set_name(name)
263 if name == "" or type(name) ~= "string" then name = nil; end 263 if name == "" or type(name) ~= "string" or name == (jid_split(self.jid)) then name = nil; end
264 if self._data.name ~= name then 264 if self._data.name ~= name then
265 self._data.name = name; 265 self._data.name = name;
266 if self.save then self:save(true); end 266 if self.save then self:save(true); end
267 end 267 end
268 end 268 end
269 function room_mt:get_name() 269 function room_mt:get_name()
270 return self._data.name; 270 return self._data.name or jid_split(self.jid);
271 end 271 end
272 function room_mt:set_description(description) 272 function room_mt:set_description(description)
273 if description == "" or type(description) ~= "string" then description = nil; end 273 if description == "" or type(description) ~= "string" then description = nil; end
274 if self._data.description ~= description then 274 if self._data.description ~= description then
275 self._data.description = description; 275 self._data.description = description;