diff options
author | nico <nico@magicbroccoli.de> | 2019-10-24 20:31:49 +0200 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2019-10-24 20:31:49 +0200 |
commit | 40edb13762a7c46b23681aca62158fd249ff9b29 (patch) | |
tree | 37cbf858674208919f14561cc9302ce17fe9028a /ejabberdrpc.py | |
parent | 1a63916b4e9911e0cd9348e95846ef9455cc97e5 (diff) |
final touches
# added
+ add method to escape whitespaces in keys and values
# changed
* init client handler only once and not every time
* don't try to create database on every run just on the first one
# removed
- vhosts are listed first and after that the respective nodes are listed
Diffstat (limited to 'ejabberdrpc.py')
-rwxr-xr-x | ejabberdrpc.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ejabberdrpc.py b/ejabberdrpc.py index b2cc908..cee769b 100755 --- a/ejabberdrpc.py +++ b/ejabberdrpc.py @@ -109,7 +109,11 @@ class EjabberdMetrics(): def fetch_muc(self, vhost=None): host = "global" if vhost is not None: - host = "conference." + vhost + version = self._cmd("status", {}) + if "19.09" in version: + host = "conference." + vhost + else: + host = vhost result = self._cmd("muc_online_rooms", {"host": host}) if "rooms" in result: return len(result["rooms"]) |