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

Don't exclude pinned messages in get_dialogs call #427

Open
wants to merge 1 commit into
base: develop
from

Conversation

@vtronko
Copy link

@vtronko vtronko commented Jun 20, 2020

Currently, when you issue a get_dialogs call with default parameters (precisely,
pinned_only=False) — pinned messages are implicitly excluded. This PR
amends that.

@delivrance
Copy link
Member

@delivrance delivrance commented Jul 8, 2020

It's often hard to make api design decisions because people will always find something that doesn't fit well for their purposes.

Here, your change is limiting in case we want to only fetch dialogs that are not pinned. The raw API actually provides two distinct methods, messages.GetPinnedDialogs and messages.GetDialogs. For convenience, pyrogram merged both methods into one. Maybe we should keep two separate convenience method too: get_pinned_dialogs, which would return a list of pinned dialogs only and get_dialogs (which should be turned into a generator and have iter_dialogs deprecated) with an optional parameter exclude_pinned. What do you think?

@JosXa
Copy link
Contributor

@JosXa JosXa commented Aug 26, 2020

I like the exclude_* approach.

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.