aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2020-02-17 01:18:46 +0100
committernico <nico@magicbroccoli.de>2020-02-17 02:05:58 +0100
commit95616508ceb29303a87b71544c3b36929c0bd3d2 (patch)
tree8dbc6e2f7a5c87dbc787336c2a5ef7042472198b
parentcf0357197e27d9cb4bf5039606c4b255e1943f46 (diff)
customizable muc host
+ add optional argument to the EjabberdMetrics class to customize the default muc host sub-domain
-rwxr-xr-xejabberdrpc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ejabberdrpc.py b/ejabberdrpc.py
index 02c0b3b..e89c14a 100755
--- a/ejabberdrpc.py
+++ b/ejabberdrpc.py
@@ -13,8 +13,9 @@ class EjabberdMetrics:
"""
class to fetch metrics per xmlrpc
"""
- def __init__(self, url, login=None, api="rpc"):
+ def __init__(self, url, login=None, api="rpc", muc_host: str = 'conference'):
self._login = login
+ self.muc_host = muc_host
if api == "rpc":
self.url = url
self._cmd = self._rpc
@@ -156,7 +157,7 @@ class EjabberdMetrics:
host = "global"
if vhost is not None:
if self._verstring.major >= 19:
- host = "conference." + vhost
+ host = '.'.join([self.muc_host, vhost])
else:
host = vhost
result = self._cmd("muc_online_rooms", {"host": host})