Skip to content

Bugfix: Improperly processing labels containing parentheses - #82

Merged
jgrevich merged 1 commit into
nu7hatch:masterfrom
ryanlchan:handle-label-parentheses
May 26, 2014
Merged

Bugfix: Improperly processing labels containing parentheses#82
jgrevich merged 1 commit into
nu7hatch:masterfrom
ryanlchan:handle-label-parentheses

Conversation

@ryanlchan

Copy link
Copy Markdown
Contributor

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:

  • 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.

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.
@webcracy

webcracy commented Oct 4, 2013

Copy link
Copy Markdown
Collaborator

👍

@webcracy

webcracy commented Oct 4, 2013

Copy link
Copy Markdown
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

@johnnyshields

Copy link
Copy Markdown
Collaborator

This issue was moved to gmailgem/gmail#82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants