Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Export specific type(user, group, channel) #79

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

zuku93
Copy link

@zuku93 zuku93 commented Aug 12, 2018

pull request for #78
user is able to select which type of chat to export(user, group, channel).

elif dialog.is_channel:
dialogType = 'channel'
else:
dialogType = 'unknown!'
Copy link
Collaborator

@Lonami Lonami Aug 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally not good. Also it's impossible that this happens.

dialogType = 'channel'
else:
dialogType = 'unknown!'
if dialogType in dialog_to_dump:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String comparison? It's better if you have something like user_enabled, and check if dialog.user and dialog.user_enabled, or something.

# dialog type to download. Options are:
# "user", "group", "channel".
# An empty list (default if omitted) means all are allowed.
DialogWhitelist = user, group, channel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps DialogFilter fits better since we're filtering the type of the dialogs.

Copy link
Collaborator

@Lonami Lonami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not good enough, string comparison is not the right thing when there are better alternatives, and also the use of magic values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants