Add unread messages, mentions count and unread mark to Dialog

This commit is contained in:
Dan 2018-07-04 21:49:11 +02:00
parent 15e3cf0fd5
commit 8b43ad8a63
2 changed files with 13 additions and 2 deletions

View File

@ -90,7 +90,10 @@ class GetDialogs(BaseClient):
dialogs.append(
pyrogram.Dialog(
id=chat_id,
top_message=messages.get(chat_id)
top_message=messages.get(chat_id),
unread_messages_count=dialog.unread_count,
unread_mentions_count=dialog.unread_mentions_count,
unread_mark=dialog.unread_mark
)
)

View File

@ -22,7 +22,15 @@ from pyrogram.api.core import Object
class Dialog(Object):
ID = 0xb0700028
def __init__(self, id: int, top_message):
def __init__(self,
id: int,
top_message,
unread_messages_count: int,
unread_mentions_count: int,
unread_mark: bool):
# TODO docstrings
self.id = id
self.top_message = top_message
self.unread_messages_count = unread_messages_count
self.unread_mentions_count = unread_mentions_count
self.unread_mark = unread_mark