-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix enums #371
Conversation
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.
Provides much more readable code than current. Creates meaningful logs with extra information.
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.
The changes seem to work alright, though reactToMessage
with a custom emoji is effectively a no-op (I think it's something wrong on Facebook's end though).
@@ -26,12 +26,11 @@ def decode(self, s, _w=WHITESPACE.match): | |||
def graphql_color_to_enum(color): | |||
if color is None: | |||
return None | |||
if len(color) == 0: | |||
if not color: | |||
return ThreadColor.MESSENGER_BLUE |
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.
I think that line 30 won't execute because there is a None check before this one (or is the not color
intended to catch another value?)
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.
The not color
is intended to catch the empty string, but I guess that could be clearer
I'll go ahead and merge this, I still don't really know what to do about the encoding errors yet, though. |
Should fix #220 and fix #368.
changeThreadColor
andreactToMessage
are not aware of this change yet.I'm having trouble with Python 2.7 encoding. Narrowed it down to:
If we can figure the encoding errors, we might be able to solve #302?