From 088a4c35c973723ebe0ecf3cc0ce9d5046de8274 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 20 Aug 2018 02:12:21 +0200 Subject: [PATCH] Add is_pinned attribute to Dialog --- pyrogram/client/methods/messages/get_dialogs.py | 3 ++- pyrogram/client/types/user_and_chats/dialog.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/methods/messages/get_dialogs.py b/pyrogram/client/methods/messages/get_dialogs.py index f43ca6a5..e7b3e2a8 100644 --- a/pyrogram/client/methods/messages/get_dialogs.py +++ b/pyrogram/client/methods/messages/get_dialogs.py @@ -92,7 +92,8 @@ class GetDialogs(BaseClient): top_message=messages.get(chat_id), unread_messages_count=dialog.unread_count, unread_mentions_count=dialog.unread_mentions_count, - unread_mark=dialog.unread_mark + unread_mark=dialog.unread_mark, + is_pinned=dialog.pinned ) ) diff --git a/pyrogram/client/types/user_and_chats/dialog.py b/pyrogram/client/types/user_and_chats/dialog.py index 60ffb76c..fa5fb2b8 100644 --- a/pyrogram/client/types/user_and_chats/dialog.py +++ b/pyrogram/client/types/user_and_chats/dialog.py @@ -37,6 +37,9 @@ class Dialog(Object): unread_mark (``bool``): True, if the dialog has the unread mark set. + + is_pinned (``bool``): + True, if the dialog is pinned. """ ID = 0xb0700028 @@ -45,9 +48,11 @@ class Dialog(Object): top_message, unread_messages_count: int, unread_mentions_count: int, - unread_mark: bool): + unread_mark: bool, + is_pinned: bool): self.chat = chat self.top_message = top_message self.unread_messages_count = unread_messages_count self.unread_mentions_count = unread_mentions_count self.unread_mark = unread_mark + self.is_pinned = is_pinned