plugin XEP-0054: renamed isInRoom to isRoom as the method only tell if the entity belong to a MUC
This commit is contained in:
parent
1b01409238
commit
b97038f281
1 changed files with 6 additions and 6 deletions
|
|
@ -109,10 +109,10 @@ class XEP_0054(object):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def isInRoom(self, client, entity_jid):
|
def isRoom(self, client, entity_jid):
|
||||||
"""Tell if an full jid is a member of a room
|
"""Tell if a jid is a MUC one
|
||||||
|
|
||||||
@param entity_jid(jid.JID): full jid of the entity
|
@param entity_jid(jid.JID): full or bare jid of the entity check
|
||||||
@return (bool): True if the bare jid of the entity is a room jid
|
@return (bool): True if the bare jid of the entity is a room jid
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
|
@ -154,7 +154,7 @@ class XEP_0054(object):
|
||||||
@param value(unicode): new value of the item
|
@param value(unicode): new value of the item
|
||||||
"""
|
"""
|
||||||
if jid_.resource:
|
if jid_.resource:
|
||||||
if not self.isInRoom(client, jid_):
|
if not self.isRoom(client, jid_):
|
||||||
# VCard are retrieved with bare jid
|
# VCard are retrieved with bare jid
|
||||||
# but MUC room is a special case
|
# but MUC room is a special case
|
||||||
jid_ = jid.userhostJID()
|
jid_ = jid.userhostJID()
|
||||||
|
|
@ -172,7 +172,7 @@ class XEP_0054(object):
|
||||||
@param name: name of the value ('nick' or 'avatar')
|
@param name: name of the value ('nick' or 'avatar')
|
||||||
@return: wanted value or None"""
|
@return: wanted value or None"""
|
||||||
if entity_jid.resource:
|
if entity_jid.resource:
|
||||||
if not self.isInRoom(client, entity_jid):
|
if not self.isRoom(client, entity_jid):
|
||||||
# VCard are retrieved with bare jid
|
# VCard are retrieved with bare jid
|
||||||
# but MUC room is a special case
|
# but MUC room is a special case
|
||||||
entity_jid = jid.userhostJID()
|
entity_jid = jid.userhostJID()
|
||||||
|
|
@ -377,7 +377,7 @@ class XEP_0054_handler(XMPPHandler):
|
||||||
@param presend(domish.Element): <presence/> stanza
|
@param presend(domish.Element): <presence/> stanza
|
||||||
"""
|
"""
|
||||||
from_jid = jid.JID(presence['from'])
|
from_jid = jid.JID(presence['from'])
|
||||||
if from_jid.resource and not self.plugin_parent.isInRoom(self.parent, from_jid):
|
if from_jid.resource and not self.plugin_parent.isRoom(self.parent, from_jid):
|
||||||
from_jid = from_jid.userhostJID()
|
from_jid = from_jid.userhostJID()
|
||||||
#FIXME: wokkel's data_form should be used here
|
#FIXME: wokkel's data_form should be used here
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue