# HG changeset patch # User Kim Alvefur # Date 1434647755 -7200 # Node ID 16396746730853e02eb1c42796171379224840fc # Parent ca48eea4785cda38726ef34349d04efbd83e3166 mod_muc_limits: Update to work with both the new and the old MUC API diff -r ca48eea4785c -r 163967467308 mod_muc_limits/mod_muc_limits.lua --- 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;