{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/40127903","id":40127903,"diff_hunk":"@@ -1840,6 +1860,46 @@ var ConversationView = {\n       }) : '';\n   },\n \n+  /**\n+   * @param  {Object} A SMS/MMS message\n+   * @return {String} The late arrival notice string\n+   */\n+  getLateArrivalNotice: function(message) {\n+    var opts = this.LATE_NOTICE_OPTS;\n+    var sent = message.sentTimestamp;\n+    var received = message.timestamp;\n+    var lateness = received - sent;\n+    var period = MONTH;\n+    var noticeL10nIds = {\n+      [MONTH]: 'late-arrival-notice-in-months',\n+      [DAY]: 'late-arrival-notice-in-days',\n+      [HOUR]: 'late-arrival-notice-in-hours',\n+      [MINUTE]: 'late-arrival-notice-in-minutes'\n+    };\n+\n+    if (!sent || !received || lateness < opts.OFF_NOTICE_LOWER_LIMIT) {\n+      return '';\n+    }\n+\n+    if (lateness < opts.IN_HOURS_LIMIT)       { period = MINUTE; } \n+    else if (lateness < opts.IN_DAYS_LIMIT)   { period = HOUR; } \n+    else if (lateness < opts.IN_MONTHS_LIMIT) { period = DAY; }\n+    \n+    var noticeNode = this.tmpl.lateArrivalNotice.prepare({\n+        noticeL10nId: noticeL10nIds[period]\n+    }).toDocumentFragment();\n+\n+    navigator.mozL10n.setAttributes(\n+      noticeNode.querySelector('.late-arrival-notice'), \n+      noticeL10nIds[period], \n+      {\n+        'lateness': (lateness - lateness % period) / period\n+      }\n+    );\n+\n+    return noticeNode.firstChild.outerHTML;","path":"apps/sms/views/conversation/js/conversation.js","position":101,"original_position":101,"commit_id":"2bdc2dbe9a495632ef77f1756a4a5fb449a14a8d","original_commit_id":"2bdc2dbe9a495632ef77f1756a4a5fb449a14a8d","user":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"body":"`mozL10n.get` is deprecated, so if you need this, use async `mozL10n.formatValue` please.\r\n\r\nBut I'm wondering if you could just assign this id/args to an element via `mozL10n.setAttributes` instead.","created_at":"2015-09-22T18:51:46Z","updated_at":"2015-09-22T18:51:46Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/31920#discussion_r40127903","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/40127903"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/31920#discussion_r40127903"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920","id":45453854,"html_url":"https://github.com/mozilla-b2g/gaia/pull/31920","diff_url":"https://github.com/mozilla-b2g/gaia/pull/31920.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/31920.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31920","number":31920,"state":"open","locked":false,"title":"Bug 1037620 - Late Arrival Notice in Messages App r=julienw","user":{"login":"sroucheray","id":169818,"avatar_url":"https://avatars.githubusercontent.com/u/169818?v=3","gravatar_id":"","url":"https://api.github.com/users/sroucheray","html_url":"https://github.com/sroucheray","followers_url":"https://api.github.com/users/sroucheray/followers","following_url":"https://api.github.com/users/sroucheray/following{/other_user}","gists_url":"https://api.github.com/users/sroucheray/gists{/gist_id}","starred_url":"https://api.github.com/users/sroucheray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroucheray/subscriptions","organizations_url":"https://api.github.com/users/sroucheray/orgs","repos_url":"https://api.github.com/users/sroucheray/repos","events_url":"https://api.github.com/users/sroucheray/events{/privacy}","received_events_url":"https://api.github.com/users/sroucheray/received_events","type":"User","site_admin":false},"body":"In SMS app :\r\nAdd a humanized lateness (diff between sent and received time) notice in the bubbles of conversation view\r\nAdd a humanized lateness message in report view","created_at":"2015-09-18T21:18:14Z","updated_at":"2015-09-22T18:51:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7b7f1bf1e1e9123a08c0529e843aa5e88b5c56d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920/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/31920/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2bdc2dbe9a495632ef77f1756a4a5fb449a14a8d","head":{"label":"sroucheray:1037620-late-arrival-notice","ref":"1037620-late-arrival-notice","sha":"2bdc2dbe9a495632ef77f1756a4a5fb449a14a8d","user":{"login":"sroucheray","id":169818,"avatar_url":"https://avatars.githubusercontent.com/u/169818?v=3","gravatar_id":"","url":"https://api.github.com/users/sroucheray","html_url":"https://github.com/sroucheray","followers_url":"https://api.github.com/users/sroucheray/followers","following_url":"https://api.github.com/users/sroucheray/following{/other_user}","gists_url":"https://api.github.com/users/sroucheray/gists{/gist_id}","starred_url":"https://api.github.com/users/sroucheray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroucheray/subscriptions","organizations_url":"https://api.github.com/users/sroucheray/orgs","repos_url":"https://api.github.com/users/sroucheray/repos","events_url":"https://api.github.com/users/sroucheray/events{/privacy}","received_events_url":"https://api.github.com/users/sroucheray/received_events","type":"User","site_admin":false},"repo":{"id":41300463,"name":"gaia","full_name":"sroucheray/gaia","owner":{"login":"sroucheray","id":169818,"avatar_url":"https://avatars.githubusercontent.com/u/169818?v=3","gravatar_id":"","url":"https://api.github.com/users/sroucheray","html_url":"https://github.com/sroucheray","followers_url":"https://api.github.com/users/sroucheray/followers","following_url":"https://api.github.com/users/sroucheray/following{/other_user}","gists_url":"https://api.github.com/users/sroucheray/gists{/gist_id}","starred_url":"https://api.github.com/users/sroucheray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroucheray/subscriptions","organizations_url":"https://api.github.com/users/sroucheray/orgs","repos_url":"https://api.github.com/users/sroucheray/repos","events_url":"https://api.github.com/users/sroucheray/events{/privacy}","received_events_url":"https://api.github.com/users/sroucheray/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sroucheray/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":true,"url":"https://api.github.com/repos/sroucheray/gaia","forks_url":"https://api.github.com/repos/sroucheray/gaia/forks","keys_url":"https://api.github.com/repos/sroucheray/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sroucheray/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sroucheray/gaia/teams","hooks_url":"https://api.github.com/repos/sroucheray/gaia/hooks","issue_events_url":"https://api.github.com/repos/sroucheray/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/sroucheray/gaia/events","assignees_url":"https://api.github.com/repos/sroucheray/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/sroucheray/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/sroucheray/gaia/tags","blobs_url":"https://api.github.com/repos/sroucheray/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sroucheray/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sroucheray/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/sroucheray/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sroucheray/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/sroucheray/gaia/languages","stargazers_url":"https://api.github.com/repos/sroucheray/gaia/stargazers","contributors_url":"https://api.github.com/repos/sroucheray/gaia/contributors","subscribers_url":"https://api.github.com/repos/sroucheray/gaia/subscribers","subscription_url":"https://api.github.com/repos/sroucheray/gaia/subscription","commits_url":"https://api.github.com/repos/sroucheray/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/sroucheray/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/sroucheray/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/sroucheray/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/sroucheray/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/sroucheray/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sroucheray/gaia/merges","archive_url":"https://api.github.com/repos/sroucheray/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sroucheray/gaia/downloads","issues_url":"https://api.github.com/repos/sroucheray/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/sroucheray/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/sroucheray/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/sroucheray/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sroucheray/gaia/labels{/name}","releases_url":"https://api.github.com/repos/sroucheray/gaia/releases{/id}","created_at":"2015-08-24T11:58:42Z","updated_at":"2015-08-24T11:59:12Z","pushed_at":"2015-09-19T09:11:40Z","git_url":"git://github.com/sroucheray/gaia.git","ssh_url":"git@github.com:sroucheray/gaia.git","clone_url":"https://github.com/sroucheray/gaia.git","svn_url":"https://github.com/sroucheray/gaia","homepage":"https://wiki.mozilla.org/B2G","size":959415,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"2c14ecccd4c5b8c1217f2adc65eeee5ba75579d1","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":"2015-09-21T20:21:10Z","pushed_at":"2015-09-22T18:50:38Z","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":1643484,"stargazers_count":1981,"watchers_count":1981,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2443,"mirror_url":null,"open_issues_count":1214,"forks":2443,"open_issues":1214,"watchers":1981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/31920"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31920"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/31920/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/31920/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/31920/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/2bdc2dbe9a495632ef77f1756a4a5fb449a14a8d"}}}}