diff options
author | daurnimator <quae@daurnimator.com> | 2014-04-02 15:14:52 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-04-02 15:14:52 -0400 |
commit | 5c2a128e96093068d94191fae472508108d43197 (patch) | |
tree | acdb4426115d7833dd15af75db4f58ceabea2275 /plugins/muc/muc.lib.lua | |
parent | 69eaebe2db313d342078bb4e1d83f693ac514f25 (diff) | |
download | prosody-5c2a128e96093068d94191fae472508108d43197.tar.gz prosody-5c2a128e96093068d94191fae472508108d43197.zip |
plugins/muc/muc.lib: Move description functions out to own file
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 07069130..ef572cfd 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -430,9 +430,6 @@ module:hook("muc-disco#info", function(event) event.reply:tag("feature", {var = event.room:get_whois() ~= "anyone" and "muc_semianonymous" or "muc_nonanonymous"}):up(); end); module:hook("muc-disco#info", function(event) - table.insert(event.form, { name = "muc#roominfo_description", label = "Description", value = event.room:get_description() }); -end); -module:hook("muc-disco#info", function(event) local count = 0; for _ in event.room:each_occupant() do count = count + 1; end table.insert(event.form, { name = "muc#roominfo_occupants", label = "Number of occupants", value = tostring(count) }); end); @@ -495,16 +492,6 @@ end function room_mt:get_name() return self._data.name or jid_split(self.jid); end -function room_mt:set_description(description) - if description == "" or type(description) ~= "string" then description = nil; end - if self._data.description ~= description then - self._data.description = description; - if self.save then self:save(true); end - end -end -function room_mt:get_description() - return self._data.description; -end function room_mt:set_password(password) if password == "" or type(password) ~= "string" then password = nil; end if self._data.password ~= password then @@ -928,14 +915,6 @@ module:hook("muc-config-form", function(event) end); module:hook("muc-config-form", function(event) table.insert(event.form, { - name = 'muc#roomconfig_roomdesc', - type = 'text-single', - label = 'Description', - value = event.room:get_description() or "", - }); -end); -module:hook("muc-config-form", function(event) - table.insert(event.form, { name = 'muc#roomconfig_persistentroom', type = 'boolean', label = 'Make Room Persistent?', @@ -1050,9 +1029,6 @@ module:hook("muc-config-submitted", function(event) event.update_option("name", "muc#roomconfig_roomname"); end); module:hook("muc-config-submitted", function(event) - event.update_option("description", "muc#roomconfig_roomdesc"); -end); -module:hook("muc-config-submitted", function(event) event.update_option("persistent", "muc#roomconfig_persistentroom"); end); module:hook("muc-config-submitted", function(event) @@ -1558,6 +1534,10 @@ function room_mt:set_role(actor, occupant_jid, role, reason) return true; end +local description = module:require "muc/description"; +room_mt.get_description = description.get; +room_mt.set_description = description.set; + local _M = {}; -- module "muc" function _M.new_room(jid, config) |