Comparison

plugins/muc/name.lib.lua @ 7352:50b24b3476e6

MUC: Provide a noop stub room:save() method
author Kim Alvefur <zash@zash.se>
date Thu, 14 Apr 2016 21:23:09 +0200
parent 7124:a0764a8d6b26
child 7353:ca31d3271cf8
comparison
equal deleted inserted replaced
7350:24e2369b67f9 7352:50b24b3476e6
15 15
16 local function set_name(room, name) 16 local function set_name(room, name)
17 if name == "" or name == (jid_split(room.jid)) then name = nil; end 17 if name == "" or name == (jid_split(room.jid)) then name = nil; end
18 if room._data.name == name then return false; end 18 if room._data.name == name then return false; end
19 room._data.name = name; 19 room._data.name = name;
20 if room.save then room:save(true); end 20 room:save(true);
21 return true; 21 return true;
22 end 22 end
23 23
24 module:hook("muc-disco#info", function(event) 24 module:hook("muc-disco#info", function(event)
25 event.reply:tag("identity", {category="conference", type="text", name=get_name(event.room)}):up(); 25 event.reply:tag("identity", {category="conference", type="text", name=get_name(event.room)}):up();