Move attributes out of Thread and into User/Page/Group
This commit is contained in:
@@ -10,6 +10,16 @@ class Group(Thread):
|
||||
|
||||
type = ThreadType.GROUP
|
||||
|
||||
#: The group's picture
|
||||
photo = attr.ib(None)
|
||||
#: The name of the group
|
||||
name = attr.ib(None)
|
||||
#: Datetime when the group was last active / when the last message was sent
|
||||
last_active = attr.ib(None)
|
||||
#: Number of messages in the group
|
||||
message_count = attr.ib(None)
|
||||
#: Set `Plan`
|
||||
plan = attr.ib(None)
|
||||
#: Unique list (set) of the group thread's participant user IDs
|
||||
participants = attr.ib(factory=set)
|
||||
#: A dictionary, containing user nicknames mapped to their IDs
|
||||
|
@@ -10,6 +10,16 @@ class Page(Thread):
|
||||
|
||||
type = ThreadType.PAGE
|
||||
|
||||
#: The page's picture
|
||||
photo = attr.ib(None)
|
||||
#: The name of the page
|
||||
name = attr.ib(None)
|
||||
#: Datetime when the thread was last active / when the last message was sent
|
||||
last_active = attr.ib(None)
|
||||
#: Number of messages in the thread
|
||||
message_count = attr.ib(None)
|
||||
#: Set `Plan`
|
||||
plan = attr.ib(None)
|
||||
#: The page's custom URL
|
||||
url = attr.ib(None)
|
||||
#: The name of the page's location city
|
||||
|
@@ -75,16 +75,6 @@ class Thread:
|
||||
uid = attr.ib(converter=str)
|
||||
#: Specifies the type of thread. Can be used a ``thread_type``. See :ref:`intro_threads` for more info
|
||||
type = None
|
||||
#: The thread's picture
|
||||
photo = attr.ib(None)
|
||||
#: The name of the thread
|
||||
name = attr.ib(None)
|
||||
#: Datetime when the thread was last active / when the last message was sent
|
||||
last_active = attr.ib(None)
|
||||
#: Number of messages in the thread
|
||||
message_count = attr.ib(None)
|
||||
#: Set `Plan`
|
||||
plan = attr.ib(None)
|
||||
|
||||
@staticmethod
|
||||
def _parse_customization_info(data):
|
||||
|
@@ -47,6 +47,16 @@ class User(Thread):
|
||||
|
||||
type = ThreadType.USER
|
||||
|
||||
#: The user's picture
|
||||
photo = attr.ib(None)
|
||||
#: The name of the user
|
||||
name = attr.ib(None)
|
||||
#: Datetime when the thread was last active / when the last message was sent
|
||||
last_active = attr.ib(None)
|
||||
#: Number of messages in the thread
|
||||
message_count = attr.ib(None)
|
||||
#: Set `Plan`
|
||||
plan = attr.ib(None)
|
||||
#: The profile URL
|
||||
url = attr.ib(None)
|
||||
#: The users first name
|
||||
|
Reference in New Issue
Block a user