GitHub PullRequestReviewCommentEvent at 2014-08-26 14:35:06
Repository: msisdn-gateway
Actor: Natim
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/comments/16716817","id":16716817,"diff_hunk":"@@ -0,0 +1,37 @@\n+/* This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this\n+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n+\"use strict\";\n+\n+var phone = require(\"phone\");\n+\n+\n+module.exports = function paramsFromRequest(params) {\n+  if (!params.hasOwnProperty(\"from\")) {\n+    return null;\n+  }\n+  var options = {\n+    msisdn: '+' + params.from,\n+    text: params.message  || \"\"\n+  };\n+\n+  // Handle req.body.mccmnc\n+  if (params.hasOwnProperty(\"mccmnc\")) {\n+    options.mcc = params.mccmnc.mcc;\n+    options.mnc = params.mccmnc.mnc;\n+\n+  // Handle req.query.mcc and req.query.mnc\n+  } else if (params.hasOwnProperty(\"mcc\")) {\n+    options.mcc = params.mcc;\n+    options.mnc = params.mnc;\n+\n+  // Guess the MCC from the MSISDN\n+  } else {\n+    var makePhone = phone(options.msisdn, \"mcc\");\n+    if (makePhone.length === 2) {\n+      options.mcc = makePhone[1];\n+    }","path":"msisdn-gateway/sms/inbound/beepsend.js","position":33,"original_position":33,"commit_id":"91b660fc4ab81e7a31c9c7bc5e3d322526232fbb","original_commit_id":"91b660fc4ab81e7a31c9c7bc5e3d322526232fbb","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=2","gravatar_id":"48e87ebebf7bee2a0ca10aa2362795a6","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"It can happen even if it unlikely to happen but if it happen it is handled correcly.","created_at":"2014-08-26T14:35:06Z","updated_at":"2014-08-26T14:35:06Z","html_url":"https://github.com/mozilla-services/msisdn-gateway/pull/131#discussion_r16716817","pull_request_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/comments/16716817"},"html":{"href":"https://github.com/mozilla-services/msisdn-gateway/pull/131#discussion_r16716817"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131","id":20308700,"html_url":"https://github.com/mozilla-services/msisdn-gateway/pull/131","diff_url":"https://github.com/mozilla-services/msisdn-gateway/pull/131.diff","patch_url":"https://github.com/mozilla-services/msisdn-gateway/pull/131.patch","issue_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/131","number":131,"state":"open","locked":false,"title":"Refactor Inbound Message: Use an Inbound Backend and only one /sms/momt/ URL","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=2","gravatar_id":"48e87ebebf7bee2a0ca10aa2362795a6","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"Refs https://github.com/mozilla-services/docs/pull/31","created_at":"2014-08-26T13:36:13Z","updated_at":"2014-08-26T14:35:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d03f9c4cdcd8150c5535d818784ab0433f6ef15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/131/comments","statuses_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/statuses/91b660fc4ab81e7a31c9c7bc5e3d322526232fbb","head":{"label":"mozilla-services:sms-backend-wrap-inbound","ref":"sms-backend-wrap-inbound","sha":"91b660fc4ab81e7a31c9c7bc5e3d322526232fbb","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=2","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":18872252,"name":"msisdn-gateway","full_name":"mozilla-services/msisdn-gateway","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=2","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/msisdn-gateway","description":"An MSISDN based Authentication Server.","fork":false,"url":"https://api.github.com/repos/mozilla-services/msisdn-gateway","forks_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/forks","keys_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/teams","hooks_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/events","assignees_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/tags","blobs_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/subscription","commits_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/merges","archive_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/downloads","issues_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/releases{/id}","created_at":"2014-04-17T08:49:19Z","updated_at":"2014-06-25T23:30:09Z","pushed_at":"2014-08-26T13:35:53Z","git_url":"git://github.com/mozilla-services/msisdn-gateway.git","ssh_url":"git@github.com:mozilla-services/msisdn-gateway.git","clone_url":"https://github.com/mozilla-services/msisdn-gateway.git","svn_url":"https://github.com/mozilla-services/msisdn-gateway","homepage":"","size":5528,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"b287319bd7f77af3c287c29b130f6a2b11408f23","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=2","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":18872252,"name":"msisdn-gateway","full_name":"mozilla-services/msisdn-gateway","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=2","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/msisdn-gateway","description":"An MSISDN based Authentication Server.","fork":false,"url":"https://api.github.com/repos/mozilla-services/msisdn-gateway","forks_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/forks","keys_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/teams","hooks_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/events","assignees_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/tags","blobs_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/subscription","commits_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/merges","archive_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/downloads","issues_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/msisdn-gateway/releases{/id}","created_at":"2014-04-17T08:49:19Z","updated_at":"2014-06-25T23:30:09Z","pushed_at":"2014-08-26T13:35:53Z","git_url":"git://github.com/mozilla-services/msisdn-gateway.git","ssh_url":"git@github.com:mozilla-services/msisdn-gateway.git","clone_url":"https://github.com/mozilla-services/msisdn-gateway.git","svn_url":"https://github.com/mozilla-services/msisdn-gateway","homepage":"","size":5528,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131"},"html":{"href":"https://github.com/mozilla-services/msisdn-gateway/pull/131"},"issue":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/131"},"comments":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/msisdn-gateway/statuses/91b660fc4ab81e7a31c9c7bc5e3d322526232fbb"}}}}