Closed yn closed 9 years ago
It'd be nice to rebase out the revert commit so the commit history is clean.
The code looks good to me (once squashed to one commit). :+1:
I kept it at 2 commits so that the two separate fixes are clear, but the reverted commit and its respective revert is gone.
Thanks for contributing & adding tests.
This has been released in version 0.6.0 of the gmail gem. Thanks for contributing!
This functionality doesn't seem to be getting much use in the wild, because this has been broken for a while and no one's stepped up, but I need it for https://github.com/yn/gmail-splitter, so here goes:
1) This worked when this file looked like the original version mentioned in the comment (https://github.com/oxos/gmail-oauth-thread-stats/blob/master/gmail_imap_extensions_compatibility.rb) but that version didn't parse spaces in labels correctly.
2) The version of imap_extensions.rb prior to this PR claimed to parse spaces correctly, but it had no specs and a gnarly off-by-one error that caused parsing errors and extraneous parens in parsed label names.
3) This PR fixed parsing errors and extraneous parens, and adds tests. The server_response lines in the spec have been copied directly from the wire.
4) The original version referenced in (1) would do the following: If GMail sent down "\Inbox" or "\Important" in a label, it would convert it to a symbol like :Inbox or :Important
5) This PR also restores that functionality.