Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mark_chat_unread() method #322

Open
wants to merge 4 commits into
base: develop
from

Conversation

@ColinTheShark
Copy link
Member

@ColinTheShark ColinTheShark commented Oct 4, 2019

Title says all. Mark a chat as unread.

https://t.me/PyrogramChat/123932

Copy link
Contributor

@JosXa JosXa left a comment

Please also add a convenience method to user_and_chats/chat.py

@delivrance
Copy link
Member

@delivrance delivrance commented Dec 23, 2019

@ColinTheShark Can you confirm this works without the need of an InputDialogPeer object?
If that works, it means the server accepts either types (as it happens in a bunch of other places) and thus I think we can accept the method having chat instead of dialog in its name for convenience.

@delivrance
Copy link
Member

@delivrance delivrance commented Dec 23, 2019

Also, what about marking a chat as read instead? The raw method allows to do that too, but the issue here is the misleading name.

@ColinTheShark
Copy link
Member Author

@ColinTheShark ColinTheShark commented Dec 23, 2019

Can you confirm this works without the need of an InputDialogPeer object?

I haven't explicitly tested against an InputDialogPeer object but I can confirm that my snippet (same raw method) works both in private- and group chats.


Please also add a convenience method to user_and_chats/chat.py

You mean a bound method, right? If so, I added that already :)


Also, what about marking a chat as read instead?

While read_history can mark up to a specific point (or the latest message if no max_id is given), MarkDialogUnread just marks as unread. I have tried with unread=False as an argument, which didn't remove the unread status. I'm sure there is a raw method to mark a chat as read without using read_history, but I believe Clients just use the raw equivalent to read_history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.