Commit a1102880 authored by nkour's avatar nkour

intro is_hidden_from_roster and is_observer

parent aae7e7e9
......@@ -67,6 +67,26 @@ class Contact:
return self.jid.split('@')[0]
def is_hidden_from_roster(self):
'''if roster should not be visible in roster'''
# JEP-0162
hide = True
if contact.sub in ('both', 'to', 'from'):
hide = False
elif contact.ask == 'subscribe':
hide = False
elif or len(contact.groups):
hide = False
return hide
def is_observer(self):
# XEP-0162:
is_observer = False
if is_hidden_in_roster() and if contact.sub == 'from':
is_observer = True
return is_observer
class GC_Contact:
'''Information concerning each groupchat contact'''
def __init__(self, room_jid='', name='', show='', status='', role='',
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment