GitHub PullRequestReviewCommentEvent at 2014-11-17 21:52:28
Repository: gaia
Actor: jrburke
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20468048","id":20468048,"diff_hunk":"@@ -1020,71 +1020,85 @@ MailComposer.prototype._handleValue = function(key, value){\n                             return address.address;\n                         }\n                     }).bind(this)));\n-                    \n+\n                 }).bind(this));\n             }).bind(this));\n             break;\n     }\n-    \n+\n     return value;\n };\n \n /**\n  * <p>Handles a list of parsed e-mail addresses, checks encoding etc.</p>\n- * \n+ *\n  * @param {Array} value A list or single e-mail address <code>{address:'...', name:'...'}</code>\n  * @return {String} Comma separated and encoded list of addresses\n  */\n MailComposer.prototype._convertAddresses = function(addresses){\n     var values = [], address;\n-    \n+\n     for(var i=0, len=addresses.length; i<len; i++){\n         address = addresses[i];\n-        \n+\n         if(address.address){\n-        \n-            // if user part of the address contains foreign symbols\n-            // make a mime word of it\n-            address.address = address.address.replace(/^.*?(?=\\@)/, (function(user){\n-                if(this._hasUTFChars(user)){\n-                    return mimelib.encodeMimeWord(user, \"Q\");\n-                }else{\n-                    return user;\n-                }\n-            }).bind(this));\n-            \n-            // If there's still foreign symbols, then punycode convert it\n-            if(this._hasUTFChars(address.address)){\n-                address.address = toPunycode(address.address);\n-            }\n-        \n-            if(!address.name){\n-                values.push(address.address);\n-            }else if(address.name){\n-                if(this._hasUTFChars(address.name)){\n-                    address.name = this._encodeMimeWord(address.name, \"Q\", 52);\n-                }else{\n-                    address.name = address.name;\n-                }\n-                values.push('\"' + address.name+'\" <'+address.address+'>');\n+            values.push(this._convertAddress(address));\n+        }\n+        if(address.group){\n+            address.name = address.name || \"Recipients\";","path":"apps/email/js/ext/mailapi/drafts/composer.js","position":802,"original_position":802,"commit_id":"2f9fa0d7ae95efd06a45c0c8577adfd1d9641be0","original_commit_id":"2f9fa0d7ae95efd06a45c0c8577adfd1d9641be0","user":{"login":"jrburke","id":73359,"avatar_url":"https://avatars.githubusercontent.com/u/73359?v=3","gravatar_id":"","url":"https://api.github.com/users/jrburke","html_url":"https://github.com/jrburke","followers_url":"https://api.github.com/users/jrburke/followers","following_url":"https://api.github.com/users/jrburke/following{/other_user}","gists_url":"https://api.github.com/users/jrburke/gists{/gist_id}","starred_url":"https://api.github.com/users/jrburke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrburke/subscriptions","organizations_url":"https://api.github.com/users/jrburke/orgs","repos_url":"https://api.github.com/users/jrburke/repos","events_url":"https://api.github.com/users/jrburke/events{/privacy}","received_events_url":"https://api.github.com/users/jrburke/received_events","type":"User","site_admin":false},"body":"Looking at the old state of the code, it would just do a `values.push(address.address);` if no name, so maybe that is good enough to replicate for this fix. I leave it up to asuth though. On the other hand, I can see wanting to normalize group entries better.","created_at":"2014-11-17T21:52:28Z","updated_at":"2014-11-17T21:52:28Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/26172#discussion_r20468048","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/20468048"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/26172#discussion_r20468048"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172","id":24513430,"html_url":"https://github.com/mozilla-b2g/gaia/pull/26172","diff_url":"https://github.com/mozilla-b2g/gaia/pull/26172.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/26172.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26172","number":26172,"state":"open","locked":false,"title":"Bug 1084216 - [Email] v2.0-specific quoting fixes","user":{"login":"asutherland","id":212206,"avatar_url":"https://avatars.githubusercontent.com/u/212206?v=3","gravatar_id":"","url":"https://api.github.com/users/asutherland","html_url":"https://github.com/asutherland","followers_url":"https://api.github.com/users/asutherland/followers","following_url":"https://api.github.com/users/asutherland/following{/other_user}","gists_url":"https://api.github.com/users/asutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/asutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutherland/subscriptions","organizations_url":"https://api.github.com/users/asutherland/orgs","repos_url":"https://api.github.com/users/asutherland/repos","events_url":"https://api.github.com/users/asutherland/events{/privacy}","received_events_url":"https://api.github.com/users/asutherland/received_events","type":"User","site_admin":false},"body":"In bug 1084216 on v2.0 email we are seeing a problem where mailcomposer\r\ngenerates encoded MIME words inside quotes and the yahoo.co.jp server\r\nis performing a rewrite that adds backslashes in very specific\r\ncircumstances.  (Specifically, when a sufficiently large attachment\r\nis attached.)\r\n\r\nThis fix consists of upstream fixes directly applied to the GELAM built\r\nlibraries.  Specifically, we are taking the core of the following\r\ncommits.  And note that the mechanism I used was just to copy and paste\r\nthe modified functions wholesale from a coherent commit; I did not\r\nattempt to do clever processing.  Specifically, we're talking about the\r\nstate at:\r\nhttps://raw.githubusercontent.com/andris9/mailcomposer/f0d4edba3a7735e8ef1b31f531abfd55633ff2fd/lib/mailcomposer.js\r\n\r\nBut the individual conceptual commits are:\r\n\r\n- a commit on the way to _encodePartialMime word in the next comit:\r\nhttps://github.com/andris9/mailcomposer/commit/6c6b5210e5ed406e1c8843d0b4c9bf2afbbed782#diff-17e37864e5d9b9e5ff32cb7ac29abd65R561\r\n\r\n- _encodePartialMimeWord which adds smarts on top of encodeMimeWord by\r\ndetecting space delimiting and encoding on a per word basis.  So it\r\nencodes \"foo bar baz\" as three separate words rather than a single big\r\nword:\r\nhttps://github.com/andris9/mailcomposer/commit/f0d4edba3a7735e8ef1b31f531abfd55633ff2fd\r\n\r\n- don't put the name in quotes if we're doing MIME word encoding:\r\nhttps://github.com/andris9/mailcomposer/commit/c723d3f882031b4633d0707c8ec94a22b83bd647\r\n\r\n- group support/refactoring.  We don't actually use this logic at all,\r\nit was just safer/saner to copy-and-paste the refactoring that included\r\nconvertAddress.  The transform is relative straightforward and mechanical:\r\nhttps://github.com/andris9/mailcomposer/commit/1dabfee6435a76dae9e3cf2a9095f90f09946ac2#diff-17e37864e5d9b9e5ff32cb7ac29abd65R407\r\n\r\nNote that this patch does include some extra whitespace changes.  I used\r\nemacs to do the change and my settings nuked the trailing whitespace.  I\r\ntried fairly diligently to undo the whitespace changes but it became a\r\nnightmare and since this is not the first time I've run into this, I've\r\ndecided we're just keeping the whitespace changes since it makes things\r\neasier in the future too.","created_at":"2014-11-17T03:41:03Z","updated_at":"2014-11-17T21:52:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e912b4b86090fd4ed725816c4cf706e93439c496","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26172/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2f9fa0d7ae95efd06a45c0c8577adfd1d9641be0","head":{"label":"asutherland:email2.0-quoting-fixes","ref":"email2.0-quoting-fixes","sha":"2f9fa0d7ae95efd06a45c0c8577adfd1d9641be0","user":{"login":"asutherland","id":212206,"avatar_url":"https://avatars.githubusercontent.com/u/212206?v=3","gravatar_id":"","url":"https://api.github.com/users/asutherland","html_url":"https://github.com/asutherland","followers_url":"https://api.github.com/users/asutherland/followers","following_url":"https://api.github.com/users/asutherland/following{/other_user}","gists_url":"https://api.github.com/users/asutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/asutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutherland/subscriptions","organizations_url":"https://api.github.com/users/asutherland/orgs","repos_url":"https://api.github.com/users/asutherland/repos","events_url":"https://api.github.com/users/asutherland/events{/privacy}","received_events_url":"https://api.github.com/users/asutherland/received_events","type":"User","site_admin":false},"repo":{"id":4201069,"name":"gaia","full_name":"asutherland/gaia","owner":{"login":"asutherland","id":212206,"avatar_url":"https://avatars.githubusercontent.com/u/212206?v=3","gravatar_id":"","url":"https://api.github.com/users/asutherland","html_url":"https://github.com/asutherland","followers_url":"https://api.github.com/users/asutherland/followers","following_url":"https://api.github.com/users/asutherland/following{/other_user}","gists_url":"https://api.github.com/users/asutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/asutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asutherland/subscriptions","organizations_url":"https://api.github.com/users/asutherland/orgs","repos_url":"https://api.github.com/users/asutherland/repos","events_url":"https://api.github.com/users/asutherland/events{/privacy}","received_events_url":"https://api.github.com/users/asutherland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/asutherland/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/asutherland/gaia","forks_url":"https://api.github.com/repos/asutherland/gaia/forks","keys_url":"https://api.github.com/repos/asutherland/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asutherland/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asutherland/gaia/teams","hooks_url":"https://api.github.com/repos/asutherland/gaia/hooks","issue_events_url":"https://api.github.com/repos/asutherland/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/asutherland/gaia/events","assignees_url":"https://api.github.com/repos/asutherland/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/asutherland/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/asutherland/gaia/tags","blobs_url":"https://api.github.com/repos/asutherland/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asutherland/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asutherland/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/asutherland/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asutherland/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/asutherland/gaia/languages","stargazers_url":"https://api.github.com/repos/asutherland/gaia/stargazers","contributors_url":"https://api.github.com/repos/asutherland/gaia/contributors","subscribers_url":"https://api.github.com/repos/asutherland/gaia/subscribers","subscription_url":"https://api.github.com/repos/asutherland/gaia/subscription","commits_url":"https://api.github.com/repos/asutherland/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/asutherland/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/asutherland/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/asutherland/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/asutherland/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/asutherland/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asutherland/gaia/merges","archive_url":"https://api.github.com/repos/asutherland/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asutherland/gaia/downloads","issues_url":"https://api.github.com/repos/asutherland/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/asutherland/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/asutherland/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/asutherland/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asutherland/gaia/labels{/name}","releases_url":"https://api.github.com/repos/asutherland/gaia/releases{/id}","created_at":"2012-05-02T08:34:39Z","updated_at":"2014-07-14T20:00:09Z","pushed_at":"2014-11-17T21:04:37Z","git_url":"git://github.com/asutherland/gaia.git","ssh_url":"git@github.com:asutherland/gaia.git","clone_url":"https://github.com/asutherland/gaia.git","svn_url":"https://github.com/asutherland/gaia","homepage":"https://wiki.mozilla.org/B2G","size":857079,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"mozilla-b2g:v2.0","ref":"v2.0","sha":"086a668942292168f312b3bb53e275fa0886fab1","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2014-11-17T21:26:35Z","pushed_at":"2014-11-17T21:35:36Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1552650,"stargazers_count":1799,"watchers_count":1799,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2052,"mirror_url":null,"open_issues_count":664,"forks":2052,"open_issues":664,"watchers":1799,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/26172"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26172"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26172/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26172/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2f9fa0d7ae95efd06a45c0c8577adfd1d9641be0"}}}}