diff options
Diffstat (limited to 'control.py')
-rw-r--r-- | control.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -73,7 +73,7 @@ class EjabberdCtl(EjabberdApi): return result return result["s2s_outgoing"] - def fetch_registered(self, vhost=None): + def fetch_registered_count(self, vhost=None): if vhost is None: result = self.cmd("stats", {"name":"registeredusers"}) if "stat" in result: @@ -82,3 +82,15 @@ class EjabberdCtl(EjabberdApi): result = self.cmd("stats_host", {"name":"registeredusers", "host": vhost}) if "stat" in result: return result["stat"] + + def fetch_muc_count(self, vhost=None, muc_host="conference"): + host = "global" + if vhost is not None: + if self.verstring.major >= 19: + host = '.'.join([muc_host, vhost]) + else: + host = vhost + result = self.cmd("muc_online_rooms", {"host": host}) + if "rooms" in result: + return len(result["rooms"]) + return len(result) |