diff options
author | Kim Alvefur <zash@zash.se> | 2016-04-14 21:23:09 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-04-14 21:23:09 +0200 |
commit | e05eb9a0d70487b62ebd85686044af7859696799 (patch) | |
tree | af82934d908985673b978521766f7f30030b771b /plugins | |
parent | 0e905606b9bf28b8744ec13bcf586678d247a027 (diff) | |
download | prosody-e05eb9a0d70487b62ebd85686044af7859696799.tar.gz prosody-e05eb9a0d70487b62ebd85686044af7859696799.zip |
MUC: Provide a noop stub room:save() method
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/affiliation_notify.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/description.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/hidden.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/members_only.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/moderated.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/muc.lib.lua | 6 | ||||
-rw-r--r-- | plugins/muc/name.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/password.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/persistent.lib.lua | 2 | ||||
-rw-r--r-- | plugins/muc/subject.lib.lua | 4 | ||||
-rw-r--r-- | plugins/muc/whois.lib.lua | 2 |
11 files changed, 16 insertions, 12 deletions
diff --git a/plugins/muc/affiliation_notify.lib.lua b/plugins/muc/affiliation_notify.lib.lua index 0b9ab325..7996c4b8 100644 --- a/plugins/muc/affiliation_notify.lib.lua +++ b/plugins/muc/affiliation_notify.lib.lua @@ -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 diff --git a/plugins/muc/description.lib.lua b/plugins/muc/description.lib.lua index c4b1bd09..8dfabbcb 100644 --- a/plugins/muc/description.lib.lua +++ b/plugins/muc/description.lib.lua @@ -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 diff --git a/plugins/muc/hidden.lib.lua b/plugins/muc/hidden.lib.lua index 35ca3026..e1821bd7 100644 --- a/plugins/muc/hidden.lib.lua +++ b/plugins/muc/hidden.lib.lua @@ -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 diff --git a/plugins/muc/members_only.lib.lua b/plugins/muc/members_only.lib.lua index d6388fc6..7a6de43b 100644 --- a/plugins/muc/members_only.lib.lua +++ b/plugins/muc/members_only.lib.lua @@ -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 diff --git a/plugins/muc/moderated.lib.lua b/plugins/muc/moderated.lib.lua index 26dcb058..a7e6314c 100644 --- a/plugins/muc/moderated.lib.lua +++ b/plugins/muc/moderated.lib.lua @@ -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 diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 02bc47f0..7ff9bde5 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -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 diff --git a/plugins/muc/name.lib.lua b/plugins/muc/name.lib.lua index d9bfc4cf..fb014f75 100644 --- a/plugins/muc/name.lib.lua +++ b/plugins/muc/name.lib.lua @@ -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 diff --git a/plugins/muc/password.lib.lua b/plugins/muc/password.lib.lua index 8c33aa9a..da122d1c 100644 --- a/plugins/muc/password.lib.lua +++ b/plugins/muc/password.lib.lua @@ -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 diff --git a/plugins/muc/persistent.lib.lua b/plugins/muc/persistent.lib.lua index a72bcbb5..60493e06 100644 --- a/plugins/muc/persistent.lib.lua +++ b/plugins/muc/persistent.lib.lua @@ -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 diff --git a/plugins/muc/subject.lib.lua b/plugins/muc/subject.lib.lua index 0b4e6fd6..2b1a2f52 100644 --- a/plugins/muc/subject.lib.lua +++ b/plugins/muc/subject.lib.lua @@ -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; diff --git a/plugins/muc/whois.lib.lua b/plugins/muc/whois.lib.lua index 2f492c45..84916c6a 100644 --- a/plugins/muc/whois.lib.lua +++ b/plugins/muc/whois.lib.lua @@ -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 |