Comparison

plugins/muc/muc.lib.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 6513:3bbd59c03aeb
child 6776:4412a2307c89
comparison
equal deleted inserted replaced
6767:d01c29b62b16 6769:4caef6d53304
1176 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;}); 1176 module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;});
1177 end 1177 end
1178 return true; 1178 return true;
1179 end 1179 end
1180 1180
1181 local affiliation_notify = module:require "muc/affiliation_notify";
1182
1183 local name = module:require "muc/name";
1184 room_mt.get_name = name.get;
1185 room_mt.set_name = name.set;
1186
1187 local description = module:require "muc/description";
1188 room_mt.get_description = description.get;
1189 room_mt.set_description = description.set;
1190
1191 local hidden = module:require "muc/hidden";
1192 room_mt.get_hidden = hidden.get;
1193 room_mt.set_hidden = hidden.set;
1194 function room_mt:get_public()
1195 return not self:get_hidden();
1196 end
1197 function room_mt:set_public(public)
1198 return self:set_hidden(not public);
1199 end
1200
1201 local password = module:require "muc/password";
1202 room_mt.get_password = password.get;
1203 room_mt.set_password = password.set;
1204
1205 local whois = module:require "muc/whois"; 1181 local whois = module:require "muc/whois";
1206 room_mt.get_whois = whois.get; 1182 room_mt.get_whois = whois.get;
1207 room_mt.set_whois = whois.set; 1183 room_mt.set_whois = whois.set;
1208
1209 local members_only = module:require "muc/members_only";
1210 room_mt.get_members_only = members_only.get;
1211 room_mt.set_members_only = members_only.set;
1212
1213 local moderated = module:require "muc/moderated";
1214 room_mt.get_moderated = moderated.get;
1215 room_mt.set_moderated = moderated.set;
1216
1217 local persistent = module:require "muc/persistent";
1218 room_mt.get_persistent = persistent.get;
1219 room_mt.set_persistent = persistent.set;
1220
1221 local subject = module:require "muc/subject";
1222 room_mt.get_changesubject = subject.get_changesubject;
1223 room_mt.set_changesubject = subject.set_changesubject;
1224 room_mt.get_subject = subject.get;
1225 room_mt.set_subject = subject.set;
1226 room_mt.send_subject = subject.send;
1227
1228 local history = module:require "muc/history";
1229 room_mt.send_history = history.send;
1230 room_mt.get_historylength = history.get_length;
1231 room_mt.set_historylength = history.set_length;
1232 1184
1233 local _M = {}; -- module "muc" 1185 local _M = {}; -- module "muc"
1234 1186
1235 function _M.new_room(jid, config) 1187 function _M.new_room(jid, config)
1236 return setmetatable({ 1188 return setmetatable({