changeset 3189:142ecb7f6338

quick frontend(contact list): new "isInRoster" method
author Goffi <goffi@goffi.org>
date Wed, 26 Feb 2020 22:03:15 +0100
parents a15773c6c273
children 1c6dacbfcf27
files sat_frontends/quick_frontend/quick_contact_list.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_contact_list.py	Wed Feb 26 22:03:15 2020 +0100
+++ b/sat_frontends/quick_frontend/quick_contact_list.py	Wed Feb 26 22:03:15 2020 +0100
@@ -135,6 +135,7 @@
         """Check if entity is in contact list
 
         An entity can be in contact list even if not in roster
+        use isInRoster to check if entity is in roster.
         @param entity (jid.JID): jid of the entity (resource is not ignored,
             use bare jid if needed)
         """
@@ -364,6 +365,14 @@
             return self._groups[group]
         return self._groups[group][name]
 
+    def isInRoster(self, entity):
+        """Tell if an entity is in roster
+
+        @param entity(jid.JID): jid of the entity
+            the bare jid will be used
+        """
+        return entity.bare in self._roster
+
     def isRoom(self, entity):
         """Helper method to know if entity is a MUC room