Comparison

mod_muc_limits/mod_muc_limits.lua @ 1768:163967467308

mod_muc_limits: Update to work with both the new and the old MUC API
author Kim Alvefur <zash@zash.se>
date Thu, 18 Jun 2015 19:15:55 +0200
parent 1428:091ee76745e8
child 3098:a81456a13797
comparison
equal deleted inserted replaced
1767:ca48eea4785c 1768:163967467308
1 1
2 local rooms = module:shared "muc/rooms"; 2 local mod_muc = module:depends"muc";
3 local rooms = rawget(mod_muc, "rooms"); -- Old MUC API
3 if not rooms then 4 if not rooms then
4 module:log("error", "This module only works on MUC components!"); 5 rooms = module:shared"muc/rooms"; -- New MUC API
5 return;
6 end 6 end
7 7
8 local jid_split, jid_bare = require "util.jid".split, require "util.jid".bare; 8 local jid_split, jid_bare = require "util.jid".split, require "util.jid".bare;
9 local st = require "util.stanza"; 9 local st = require "util.stanza";
10 local new_throttle = require "util.throttle".create; 10 local new_throttle = require "util.throttle".create;