aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-04-02 15:14:52 -0400
committerdaurnimator <quae@daurnimator.com>2014-04-02 15:14:52 -0400
commit906e49003903ef31a24eba95b20f9d4b1fc21431 (patch)
treeacdb4426115d7833dd15af75db4f58ceabea2275 /plugins/muc/muc.lib.lua
parent1782c1a4b939afc68f4ccee448726f61dfc58c44 (diff)
downloadprosody-906e49003903ef31a24eba95b20f9d4b1fc21431.tar.gz
prosody-906e49003903ef31a24eba95b20f9d4b1fc21431.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.lua28
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)