-
Notifications
You must be signed in to change notification settings - Fork 96
Export specific type(user, group, channel) #79
base: master
Are you sure you want to change the base?
Conversation
elif dialog.is_channel: | ||
dialogType = 'channel' | ||
else: | ||
dialogType = 'unknown!' |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
pull request for #78
user is able to select which type of chat to export(user, group, channel).