MUC: Provide a noop stub room:save() method
authorKim Alvefur <zash@zash.se>
Thu, 14 Apr 2016 19:23:09 +0000 (21:23 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 14 Apr 2016 19:23:09 +0000 (21:23 +0200)
plugins/muc/affiliation_notify.lib.lua
plugins/muc/description.lib.lua
plugins/muc/hidden.lib.lua
plugins/muc/members_only.lib.lua
plugins/muc/moderated.lib.lua
plugins/muc/muc.lib.lua
plugins/muc/name.lib.lua
plugins/muc/password.lib.lua
plugins/muc/persistent.lib.lua
plugins/muc/subject.lib.lua
plugins/muc/whois.lib.lua

index 0b9ab32597545e2a1468921d8008d7cdc7099e9c..7996c4b8130d6d8eeb932a2df92d5471479036d4 100644 (file)
@@ -24,7 +24,7 @@ local function set_affiliation_notify(room, affiliation_notify)
        affiliation_notify = affiliation_notify and true or nil;
        if room._data.affiliation_notify == affiliation_notify then return false; end
        room._data.affiliation_notify = affiliation_notify;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index c4b1bd093c7df86d1e060e419ae9e16426b5dd84..8dfabbcba922dbf9b528756f8e4a11b81ace76dc 100644 (file)
@@ -15,7 +15,7 @@ local function set_description(room, description)
        if description == "" then description = nil; end
        if get_description(room) == description then return false; end
        room._data.description = description;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index 35ca302636e618226f5440958903318e338a2ca3..e1821bd795b3afaf2d4816f3b4cbded6f48494b2 100644 (file)
@@ -15,7 +15,7 @@ local function set_hidden(room, hidden)
        hidden = hidden and true or nil;
        if get_hidden(room) == hidden then return false; end
        room._data.hidden = hidden;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index d6388fc6a515ed48583fd3aa0b502bf241234938..7a6de43bcb6018b660470413dcb93dd2287c4082 100644 (file)
@@ -44,7 +44,7 @@ local function set_members_only(room, members_only)
                        module:fire_event("muc-occupant-left", {room = room; nick = occupant.nick; occupant = occupant;});
                end
        end
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index 26dcb05823acdf66f0bfba1b4d9c7185b2b04ab3..a7e6314ce66f44b00ae3e572a80b22393f7fea6a 100644 (file)
@@ -15,7 +15,7 @@ local function set_moderated(room, moderated)
        moderated = moderated and true or nil;
        if get_moderated(room) == moderated then return false; end
        room._data.moderated = moderated;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index 02bc47f0a035af4117d9eedbdc32b9e30d39f7ef..7ff9bde5149e6eb995a31469b8a279a84c9f83d7 100644 (file)
@@ -36,6 +36,10 @@ function room_mt:__tostring()
        return "MUC room ("..self.jid..")";
 end
 
+function room_mt.save()
+       -- overriden by mod_muc.lua
+end
+
 function room_mt:get_occupant_jid(real_jid)
        return self._jid_nick[real_jid]
 end
@@ -695,7 +699,7 @@ function room_mt:process_form(origin, stanza)
                end
                event.field, event.value = nil, nil;
 
-               if self.save then self:save(true); end
+               self:save(true);
                origin.send(st.reply(stanza));
 
                if next(event.status_codes) then
index d9bfc4cf0f0a2315ca447ef7daaaa9c4ecf9d5de..fb014f759eb4edefba48fd7b43fd68616e79d0cd 100644 (file)
@@ -17,7 +17,7 @@ local function set_name(room, name)
        if name == "" or name == (jid_split(room.jid)) then name = nil; end
        if room._data.name == name then return false; end
        room._data.name = name;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index 8c33aa9a3e376288bf6065ff2acff662f3439f68..da122d1c4973579c589580ab56c43851abf0a1e7 100644 (file)
@@ -17,7 +17,7 @@ local function set_password(room, password)
        if password == "" then password = nil; end
        if room._data.password == password then return false; end
        room._data.password = password;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index a72bcbb54bb19354bed042a2473e63c8ce3f278a..60493e0637c86320aac9d22519488ddd6a68c7bc 100644 (file)
@@ -15,7 +15,7 @@ local function set_persistent(room, persistent)
        persistent = persistent and true or nil;
        if get_persistent(room) == persistent then return false; end
        room._data.persistent = persistent;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
index 0b4e6fd6cf35c59c7abfb7d3e934097eb12e8df2..2b1a2f52ea35b286639abf44e7ac3d7171f00ab9 100644 (file)
@@ -25,7 +25,7 @@ local function set_changesubject(room, changesubject)
        changesubject = changesubject and true or nil;
        if get_changesubject(room) == changesubject then return false; end
        room._data.changesubject = changesubject;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end
 
@@ -61,7 +61,7 @@ local function set_subject(room, from, subject)
        if old_subject == subject and old_from == from then return false; end
        room._data.subject_from = from;
        room._data.subject = subject;
-       if room.save then room:save(); end
+       room:save();
        local msg = create_subject_message(from, subject);
        room:broadcast_message(msg);
        return true;
index 2f492c450dcbc5eb968d11c3730f761800fa1ff2..84916c6a164c0deed09a2af9d0780ab8a54407dc 100644 (file)
@@ -20,7 +20,7 @@ local function set_whois(room, whois)
        assert(valid_whois[whois], "Invalid whois value")
        if get_whois(room) == whois then return false; end
        room._data.whois = whois;
-       if room.save then room:save(true); end
+       room:save(true);
        return true;
 end