Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0045.py @ 791:23b0c949b86c
plugins room games, XEP-0045: small fixes, improved docstrings
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 10 Jan 2014 18:07:36 +0100 |
parents | bfabeedbf32e |
children | 02ee9ef95277 |
comparison
equal
deleted
inserted
replaced
790:19262fb77230 | 791:23b0c949b86c |
---|---|
137 @user: JID or unicode (JID userhost). | 137 @user: JID or unicode (JID userhost). |
138 @param secure: set to True for a secure check | 138 @param secure: set to True for a secure check |
139 @return: the nick or None if the user didn't join the room. | 139 @return: the nick or None if the user didn't join the room. |
140 """ | 140 """ |
141 if not isinstance(user_jid, jid.JID): | 141 if not isinstance(user_jid, jid.JID): |
142 user_jid = jid.JID(user_jid) | 142 user_jid = jid.JID(user_jid).userhostJID() |
143 for user in room.roster.values(): | 143 for user in room.roster.values(): |
144 if user.entity is not None: | 144 if user.entity is not None: |
145 if user.entity.userhostJID() == user_jid.userhostJID(): | 145 if user.entity.userhostJID() == user_jid.userhostJID(): |
146 return user.nick | 146 return user.nick |
147 elif not secure: | 147 elif not secure: |