Bugfix: Improperly processing labels containing parentheses - #82
Merged
Conversation
Gmail gem previously considered labels to be processable as flags. However, due to the way Net::IMAP's regexps are constructed, they do not handle parentheses within flag data properly. This commit creates dedicated functions to process Gmail label data: * Net::IMAP::ResponseParser#x_gm_labels_data is based on #flags_data, but calls the new function x_gm_label_list * Net::IMAP::ResponseParser#x_gm_label_list is based on #flag_list, but uses an updated regexp which captures strings entirely, including nested parentheses * String#unescape allows the client to unescape the label names, which are returned as escaped strings As of writing, all specs still pass. No specs have been provided for the unescaping code, as this was pulled from another project and is not core to Gmail gem.
Collaborator
|
👍 |
Collaborator
|
It would be nice to have a test to create and read a folder with special characters in the name. Relates to issue #89 |
jgrevich
added a commit
that referenced
this pull request
May 26, 2014
Bugfix: Improperly processing labels containing parentheses
This was referenced Jan 15, 2015
Closed
This was referenced Jan 17, 2015
Collaborator
|
This issue was moved to gmailgem/gmail#82 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gmail gem previously considered labels to be processable as flags. However, due to the way Net::IMAP's regexps are constructed, they do not handle parentheses within flag data properly (as described in #81).
This commit creates dedicated functions to process Gmail label data:
new function x_gm_label_list
updated regexp which captures strings entirely, including nested parentheses
returned as escaped strings
As of writing, all specs still pass. No specs have been provided for the
unescaping code, as this was pulled from another project and is not core to
Gmail gem.