Comparison

plugins/muc/whois.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 7075:47a2deb74b56
child 7353:ca31d3271cf8
comparison
equal deleted inserted replaced
7350:24e2369b67f9 7352:50b24b3476e6
18 18
19 local function set_whois(room, whois) 19 local function set_whois(room, whois)
20 assert(valid_whois[whois], "Invalid whois value") 20 assert(valid_whois[whois], "Invalid whois value")
21 if get_whois(room) == whois then return false; end 21 if get_whois(room) == whois then return false; end
22 room._data.whois = whois; 22 room._data.whois = whois;
23 if room.save then room:save(true); end 23 room:save(true);
24 return true; 24 return true;
25 end 25 end
26 26
27 module:hook("muc-disco#info", function(event) 27 module:hook("muc-disco#info", function(event)
28 event.reply:tag("feature", {var = get_whois(event.room) ~= "anyone" and "muc_semianonymous" or "muc_nonanonymous"}):up(); 28 event.reply:tag("feature", {var = get_whois(event.room) ~= "anyone" and "muc_semianonymous" or "muc_nonanonymous"}):up();