Merge Room
with Group
model
This commit is contained in:
committed by
GitHub
parent
28e3b6285e
commit
d6ca091b7b
@@ -102,8 +102,16 @@ class Group(Thread):
|
||||
color = None
|
||||
#: The groups's default emoji
|
||||
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`"""
|
||||
super(Group, self).__init__(ThreadType.GROUP, uid, **kwargs)
|
||||
if participants is None:
|
||||
@@ -114,24 +122,6 @@ class Group(Thread):
|
||||
self.nicknames = nicknames
|
||||
self.color = color
|
||||
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:
|
||||
admins = set()
|
||||
self.admins = admins
|
||||
@@ -140,8 +130,6 @@ class Room(Group):
|
||||
approval_requests = set()
|
||||
self.approval_requests = approval_requests
|
||||
self.join_link = join_link
|
||||
self.privacy_mode = privacy_mode
|
||||
|
||||
|
||||
class Page(Thread):
|
||||
#: The page's custom url
|
||||
@@ -531,7 +519,6 @@ class ThreadType(Enum):
|
||||
USER = 1
|
||||
GROUP = 2
|
||||
PAGE = 3
|
||||
ROOM = 4
|
||||
|
||||
class ThreadLocation(Enum):
|
||||
"""Used to specify where a thread is located (inbox, pending, archived, other)."""
|
||||
|
Reference in New Issue
Block a user