# HG changeset patch # User Goffi # Date 1514935111 -3600 # Node ID 2cad04f38bac1a62239a46cc81259c6141065cc0 # Parent 34cb8b71337088b0e7d2db426f4e141ffb48b30b plugin XEP-0054: return always False in isRoom is plugin XEP-0045 is not available + raise NotFound if avatar is requested for a MUC room (not the occupants, the room itself) diff -r 34cb8b713370 -r 2cad04f38bac src/plugins/plugin_xep_0054.py --- a/src/plugins/plugin_xep_0054.py Wed Jan 03 00:16:23 2018 +0100 +++ b/src/plugins/plugin_xep_0054.py Wed Jan 03 00:18:31 2018 +0100 @@ -98,7 +98,12 @@ @return (bool): True if the bare jid of the entity is a room jid """ try: - self.host.plugins['XEP-0045'].checkRoomJoined(client, entity_jid.userhostJID()) + muc_plg = self.host.plugins['XEP-0045'] + except KeyError: + return False + + try: + muc_plg.checkRoomJoined(client, entity_jid.userhostJID()) except exceptions.NotFound: return False else: @@ -356,6 +361,8 @@ @param hash_only(bool): if True only return hash, not full path @raise exceptions.NotFound: no avatar found """ + if not entity.resource and self.isRoom(client, entity): + raise exceptions.NotFound entity = self.getBareOrFull(client, entity) full_path = None