aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2015-07-27 18:34:51 +1000
committerdaurnimator <quae@daurnimator.com>2015-07-27 18:34:51 +1000
commit02e80f65d5f2dde0cc51768fb4625f149f349ae9 (patch)
treea7de2bc2db31c6b1b0f63371499f9c1c43d749c7
parentd2d92d933717827460c637421172b410f574e619 (diff)
downloadprosody-02e80f65d5f2dde0cc51768fb4625f149f349ae9.tar.gz
prosody-02e80f65d5f2dde0cc51768fb4625f149f349ae9.zip
plugins/muc: Move loading of optional muc libraries from muc.lib.lua to mod_muc
-rw-r--r--plugins/muc/mod_muc.lua49
-rw-r--r--plugins/muc/muc.lib.lua48
2 files changed, 49 insertions, 48 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 03a23e09..81049f35 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -12,6 +12,55 @@ end
local muclib = module:require "muc";
room_mt = muclib.room_mt; -- Yes, global.
+
+local affiliation_notify = module:require "muc/affiliation_notify";
+
+local name = module:require "muc/name";
+room_mt.get_name = name.get;
+room_mt.set_name = name.set;
+
+local description = module:require "muc/description";
+room_mt.get_description = description.get;
+room_mt.set_description = description.set;
+
+local hidden = module:require "muc/hidden";
+room_mt.get_hidden = hidden.get;
+room_mt.set_hidden = hidden.set;
+function room_mt:get_public()
+ return not self:get_hidden();
+end
+function room_mt:set_public(public)
+ return self:set_hidden(not public);
+end
+
+local password = module:require "muc/password";
+room_mt.get_password = password.get;
+room_mt.set_password = password.set;
+
+local members_only = module:require "muc/members_only";
+room_mt.get_members_only = members_only.get;
+room_mt.set_members_only = members_only.set;
+
+local moderated = module:require "muc/moderated";
+room_mt.get_moderated = moderated.get;
+room_mt.set_moderated = moderated.set;
+
+local persistent = module:require "muc/persistent";
+room_mt.get_persistent = persistent.get;
+room_mt.set_persistent = persistent.set;
+
+local subject = module:require "muc/subject";
+room_mt.get_changesubject = subject.get_changesubject;
+room_mt.set_changesubject = subject.set_changesubject;
+room_mt.get_subject = subject.get;
+room_mt.set_subject = subject.set;
+room_mt.send_subject = subject.send;
+
+local history = module:require "muc/history";
+room_mt.send_history = history.send;
+room_mt.get_historylength = history.get_length;
+room_mt.set_historylength = history.set_length;
+
local iterators = require "util.iterators";
local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 75caa233..63204d66 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1178,58 +1178,10 @@ function room_mt:set_role(actor, occupant_jid, role, reason)
return true;
end
-local affiliation_notify = module:require "muc/affiliation_notify";
-
-local name = module:require "muc/name";
-room_mt.get_name = name.get;
-room_mt.set_name = name.set;
-
-local description = module:require "muc/description";
-room_mt.get_description = description.get;
-room_mt.set_description = description.set;
-
-local hidden = module:require "muc/hidden";
-room_mt.get_hidden = hidden.get;
-room_mt.set_hidden = hidden.set;
-function room_mt:get_public()
- return not self:get_hidden();
-end
-function room_mt:set_public(public)
- return self:set_hidden(not public);
-end
-
-local password = module:require "muc/password";
-room_mt.get_password = password.get;
-room_mt.set_password = password.set;
-
local whois = module:require "muc/whois";
room_mt.get_whois = whois.get;
room_mt.set_whois = whois.set;
-local members_only = module:require "muc/members_only";
-room_mt.get_members_only = members_only.get;
-room_mt.set_members_only = members_only.set;
-
-local moderated = module:require "muc/moderated";
-room_mt.get_moderated = moderated.get;
-room_mt.set_moderated = moderated.set;
-
-local persistent = module:require "muc/persistent";
-room_mt.get_persistent = persistent.get;
-room_mt.set_persistent = persistent.set;
-
-local subject = module:require "muc/subject";
-room_mt.get_changesubject = subject.get_changesubject;
-room_mt.set_changesubject = subject.set_changesubject;
-room_mt.get_subject = subject.get;
-room_mt.set_subject = subject.set;
-room_mt.send_subject = subject.send;
-
-local history = module:require "muc/history";
-room_mt.send_history = history.send;
-room_mt.get_historylength = history.get_length;
-room_mt.set_historylength = history.set_length;
-
local _M = {}; -- module "muc"
function _M.new_room(jid, config)