Merge Room with Group model

This commit is contained in:
Kacper Ziubryniewicz
2018-08-30 19:56:18 +02:00
committed by GitHub
parent 28e3b6285e
commit d6ca091b7b

View File

@@ -102,8 +102,16 @@ class Group(Thread):
color = None color = None
#: The groups's default emoji #: The groups's default emoji
emoji = None emoji = None
# Set containing user IDs of thread admins
admins = None
# True if users need approval to join
approval_mode = None
# Set containing user IDs requesting to join
approval_requests = None
# Link for joining group
join_link = None
def __init__(self, uid, participants=None, nicknames=None, color=None, emoji=None, **kwargs): def __init__(self, uid, participants=None, nicknames=None, color=None, emoji=None, admins=None, approval_mode=None, approval_requests=None, join_link=None, privacy_mode=None, **kwargs):
"""Represents a Facebook group. Inherits `Thread`""" """Represents a Facebook group. Inherits `Thread`"""
super(Group, self).__init__(ThreadType.GROUP, uid, **kwargs) super(Group, self).__init__(ThreadType.GROUP, uid, **kwargs)
if participants is None: if participants is None:
@@ -114,24 +122,6 @@ class Group(Thread):
self.nicknames = nicknames self.nicknames = nicknames
self.color = color self.color = color
self.emoji = emoji self.emoji = emoji
class Room(Group):
# Set containing user IDs of thread admins
admins = None
# True if users need approval to join
approval_mode = None
# Set containing user IDs requesting to join
approval_requests = None
# Link for joining room
join_link = None
# True is room is not discoverable
privacy_mode = None
def __init__(self, uid, admins=None, approval_mode=None, approval_requests=None, join_link=None, privacy_mode=None, **kwargs):
"""Represents a Facebook room. Inherits `Group`"""
super(Room, self).__init__(uid, **kwargs)
self.type = ThreadType.ROOM
if admins is None: if admins is None:
admins = set() admins = set()
self.admins = admins self.admins = admins
@@ -140,8 +130,6 @@ class Room(Group):
approval_requests = set() approval_requests = set()
self.approval_requests = approval_requests self.approval_requests = approval_requests
self.join_link = join_link self.join_link = join_link
self.privacy_mode = privacy_mode
class Page(Thread): class Page(Thread):
#: The page's custom url #: The page's custom url
@@ -531,7 +519,6 @@ class ThreadType(Enum):
USER = 1 USER = 1
GROUP = 2 GROUP = 2
PAGE = 3 PAGE = 3
ROOM = 4
class ThreadLocation(Enum): class ThreadLocation(Enum):
"""Used to specify where a thread is located (inbox, pending, archived, other).""" """Used to specify where a thread is located (inbox, pending, archived, other)."""