Comparison

plugins/muc/mod_muc.lua @ 6769:4caef6d53304

plugins/muc: Move loading of optional muc libraries from muc.lib.lua to mod_muc
author daurnimator <quae@daurnimator.com>
date Mon, 27 Jul 2015 18:34:51 +1000
parent 6745:6728ad041761
child 6770:cb84731b2dfd
comparison
equal deleted inserted replaced
6767:d01c29b62b16 6769:4caef6d53304
10 error("MUC should be loaded as a component, please see http://prosody.im/doc/components", 0); 10 error("MUC should be loaded as a component, please see http://prosody.im/doc/components", 0);
11 end 11 end
12 12
13 local muclib = module:require "muc"; 13 local muclib = module:require "muc";
14 room_mt = muclib.room_mt; -- Yes, global. 14 room_mt = muclib.room_mt; -- Yes, global.
15
16 local affiliation_notify = module:require "muc/affiliation_notify";
17
18 local name = module:require "muc/name";
19 room_mt.get_name = name.get;
20 room_mt.set_name = name.set;
21
22 local description = module:require "muc/description";
23 room_mt.get_description = description.get;
24 room_mt.set_description = description.set;
25
26 local hidden = module:require "muc/hidden";
27 room_mt.get_hidden = hidden.get;
28 room_mt.set_hidden = hidden.set;
29 function room_mt:get_public()
30 return not self:get_hidden();
31 end
32 function room_mt:set_public(public)
33 return self:set_hidden(not public);
34 end
35
36 local password = module:require "muc/password";
37 room_mt.get_password = password.get;
38 room_mt.set_password = password.set;
39
40 local members_only = module:require "muc/members_only";
41 room_mt.get_members_only = members_only.get;
42 room_mt.set_members_only = members_only.set;
43
44 local moderated = module:require "muc/moderated";
45 room_mt.get_moderated = moderated.get;
46 room_mt.set_moderated = moderated.set;
47
48 local persistent = module:require "muc/persistent";
49 room_mt.get_persistent = persistent.get;
50 room_mt.set_persistent = persistent.set;
51
52 local subject = module:require "muc/subject";
53 room_mt.get_changesubject = subject.get_changesubject;
54 room_mt.set_changesubject = subject.set_changesubject;
55 room_mt.get_subject = subject.get;
56 room_mt.set_subject = subject.set;
57 room_mt.send_subject = subject.send;
58
59 local history = module:require "muc/history";
60 room_mt.send_history = history.send;
61 room_mt.get_historylength = history.get_length;
62 room_mt.set_historylength = history.set_length;
63
15 local iterators = require "util.iterators"; 64 local iterators = require "util.iterators";
16 local jid_split = require "util.jid".split; 65 local jid_split = require "util.jid".split;
17 local jid_bare = require "util.jid".bare; 66 local jid_bare = require "util.jid".bare;
18 local st = require "util.stanza"; 67 local st = require "util.stanza";
19 local um_is_admin = require "core.usermanager".is_admin; 68 local um_is_admin = require "core.usermanager".is_admin;