From b97038f281878a758fe97d9c618c063c4e42ff63 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 9 Sep 2016 23:54:33 +0200 Subject: [PATCH] plugin XEP-0054: renamed isInRoom to isRoom as the method only tell if the entity belong to a MUC --- src/plugins/plugin_xep_0054.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/plugin_xep_0054.py b/src/plugins/plugin_xep_0054.py index ccb906d0..bdb0f72d 100755 --- a/src/plugins/plugin_xep_0054.py +++ b/src/plugins/plugin_xep_0054.py @@ -109,10 +109,10 @@ class XEP_0054(object): return True - def isInRoom(self, client, entity_jid): - """Tell if an full jid is a member of a room + def isRoom(self, client, entity_jid): + """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 """ try: @@ -154,7 +154,7 @@ class XEP_0054(object): @param value(unicode): new value of the item """ if jid_.resource: - if not self.isInRoom(client, jid_): + if not self.isRoom(client, jid_): # VCard are retrieved with bare jid # but MUC room is a special case jid_ = jid.userhostJID() @@ -172,7 +172,7 @@ class XEP_0054(object): @param name: name of the value ('nick' or 'avatar') @return: wanted value or None""" if entity_jid.resource: - if not self.isInRoom(client, entity_jid): + if not self.isRoom(client, entity_jid): # VCard are retrieved with bare jid # but MUC room is a special case entity_jid = jid.userhostJID() @@ -377,7 +377,7 @@ class XEP_0054_handler(XMPPHandler): @param presend(domish.Element): stanza """ 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() #FIXME: wokkel's data_form should be used here try: