Commit 062b62db authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

CapsCache: Add room info query

parent 0334f676
Pipeline #3568 passed with stages
in 2 minutes and 53 seconds
......@@ -504,3 +504,21 @@ class MucCapsCache:
except KeyError:
return allowed
def get_room_infos(self, jid):
room_info = {}
if jid in self.cache:
for form in self.cache[jid].data:
room_info['name'] = form['muc#roomconfig_roomname'].value
except KeyError:
room_info['name'] = None
room_info['desc'] = form['muc#roominfo_description'].value
except KeyError:
room_info['desc'] = None
room_info['lang'] = form['muc#roominfo_lang'].value
except KeyError:
room_info['lang'] = None
return room_info or None
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment