Diff

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
line wrap: on
line diff
--- a/mod_muc_limits/mod_muc_limits.lua	Mon Jun 08 15:29:33 2015 +0200
+++ b/mod_muc_limits/mod_muc_limits.lua	Thu Jun 18 19:15:55 2015 +0200
@@ -1,8 +1,8 @@
 
-local rooms = module:shared "muc/rooms";
+local mod_muc = module:depends"muc";
+local rooms = rawget(mod_muc, "rooms"); -- Old MUC API
 if not rooms then
-	module:log("error", "This module only works on MUC components!");
-	return;
+	rooms = module:shared"muc/rooms"; -- New MUC API
 end
 
 local jid_split, jid_bare = require "util.jid".split, require "util.jid".bare;