memory, plugin XEP-0045: getMainResource returns None when asking a MUC entity + fixes /whois on a MUC (bare) entity
This commit is contained in:
parent
9071298061
commit
3bff0d0237
1 changed files with 17 additions and 0 deletions
|
|
@ -153,6 +153,16 @@ class XEP_0045(object):
|
|||
self.host.bridge.newAlert(mess, D_("Group chat error"), "ERROR", profile)
|
||||
raise failure
|
||||
|
||||
def isRoom(self, entity_bare, profile_key):
|
||||
"""Tell if a bare entity is a MUC room.
|
||||
|
||||
@param entity_bare (jid.JID): bare entity
|
||||
@param profile_key (unicode): %(doc_profile_key)s
|
||||
@return bool
|
||||
"""
|
||||
profile = self.host.memory.getProfileName(profile_key)
|
||||
return entity_bare in self.clients[profile].joined_rooms
|
||||
|
||||
def getRoomsJoined(self, profile_key=C.PROF_KEY_NONE):
|
||||
"""Return room where user is"""
|
||||
profile = self.host.memory.getProfileName(profile_key)
|
||||
|
|
@ -615,6 +625,8 @@ class XEP_0045(object):
|
|||
if target_jid.userhostJID() not in self.clients[profile].joined_rooms:
|
||||
log.warning(_("This room has not been joined"))
|
||||
return
|
||||
if not target_jid.resource:
|
||||
return
|
||||
user = self.clients[profile].joined_rooms[target_jid.userhostJID()].getUser(target_jid.resource)
|
||||
whois_msg.append(_("Nickname: %s") % user.nick)
|
||||
if user.entity:
|
||||
|
|
|
|||
Loading…
Reference in a new issue