changeset 2060:d44360763262

plugin XEP-0054: renamed isInRoom to isRoom as the method only tell if the entity belong to a MUC
author Goffi <goffi@goffi.org>
date Fri, 09 Sep 2016 23:54:33 +0200
parents 9dd76a5b63ba
children 748e539c5feb
files src/plugins/plugin_xep_0054.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Fri Sep 09 23:54:33 2016 +0200
+++ b/src/plugins/plugin_xep_0054.py	Fri Sep 09 23:54:33 2016 +0200
@@ -109,10 +109,10 @@
 
         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 @@
         @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 @@
         @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 @@
         @param presend(domish.Element): <presence/> 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: