{"action":"created","comment":{"url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/comments/49846528","id":49846528,"diff_hunk":"@@ -46,24 +46,23 @@ private String parseSchema() throws URISyntaxException {\n   private String parsePath() throws URISyntaxException {\n     String[] parts = uri.split(\"\\\\?\")[0].split(\":\", 2);\n \n-    if (parts.length < 2 || parts[1].isEmpty()) throw new URISyntaxException(uri, \"invalid path\");\n-    else                                        return parts[1];\n+    if (parts.length < 2) throw new URISyntaxException(uri, \"invalid path\");\n+    else                  return parts[1];\n   }\n \n   private Map<String, String> parseQueryParams() throws URISyntaxException {\n     Map<String, String> queryParams = new HashMap<>();\n-    if (uri.split(\"\\\\?\").length < 2) {\n-      return queryParams;\n-    }\n-\n-    for (String keyValue : uri.split(\"\\\\?\")[1].split(\"&\")) {\n-      String[] parts = keyValue.split(\"=\");\n+    if (uri.split(\"\\\\?\").length > 1) {\n+      for (String keyValue : uri.split(\"\\\\?\")[1].split(\"&\")) {\n+        String[] parts = keyValue.split(\"=\");\n \n-      if (parts.length == 1) queryParams.put(parts[0], \"\");\n-      else                  queryParams.put(parts[0], URLDecoder.decode(parts[1]));\n+        if (parts.length == 1) queryParams.put(parts[0], \"\");\n+        else                   queryParams.put(parts[0], URLDecoder.decode(parts[1]));\n+      }\n     }\n \n-    return queryParams;\n+    if (path.isEmpty() && !queryParams.containsKey(\"body\")) throw new URISyntaxException(uri, \"missing recipient(s)\");","path":"src/org/thoughtcrime/securesms/util/Rfc5724Uri.java","position":30,"original_position":30,"commit_id":"21a3af9371f07e7bec25f2be7a99d23128621ddc","original_commit_id":"21a3af9371f07e7bec25f2be7a99d23128621ddc","user":{"login":"samlanning","id":3319932,"avatar_url":"https://avatars.githubusercontent.com/u/3319932?v=3","gravatar_id":"","url":"https://api.github.com/users/samlanning","html_url":"https://github.com/samlanning","followers_url":"https://api.github.com/users/samlanning/followers","following_url":"https://api.github.com/users/samlanning/following{/other_user}","gists_url":"https://api.github.com/users/samlanning/gists{/gist_id}","starred_url":"https://api.github.com/users/samlanning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samlanning/subscriptions","organizations_url":"https://api.github.com/users/samlanning/orgs","repos_url":"https://api.github.com/users/samlanning/repos","events_url":"https://api.github.com/users/samlanning/events{/privacy}","received_events_url":"https://api.github.com/users/samlanning/received_events","type":"User","site_admin":false},"body":"I'm not personally a fan of using the path parameter here like this, it now adds an explicit call order requirement for these methods in the constructor. I personally think it would probably be an improvement to make these methods static, and pass in the properties that are currently used as method arguments.","created_at":"2016-01-15T11:58:11Z","updated_at":"2016-01-15T11:58:11Z","html_url":"https://github.com/WhisperSystems/Signal-Android/pull/5017#discussion_r49846528","pull_request_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017","_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/comments/49846528"},"html":{"href":"https://github.com/WhisperSystems/Signal-Android/pull/5017#discussion_r49846528"},"pull_request":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017"}}},"pull_request":{"url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017","id":54924511,"html_url":"https://github.com/WhisperSystems/Signal-Android/pull/5017","diff_url":"https://github.com/WhisperSystems/Signal-Android/pull/5017.diff","patch_url":"https://github.com/WhisperSystems/Signal-Android/pull/5017.patch","issue_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/5017","number":5017,"state":"open","locked":false,"title":"Support \"sms:\" URIs with \"body\" parameter but no recipient(s)","user":{"login":"pgaubatz","id":103894,"avatar_url":"https://avatars.githubusercontent.com/u/103894?v=3","gravatar_id":"","url":"https://api.github.com/users/pgaubatz","html_url":"https://github.com/pgaubatz","followers_url":"https://api.github.com/users/pgaubatz/followers","following_url":"https://api.github.com/users/pgaubatz/following{/other_user}","gists_url":"https://api.github.com/users/pgaubatz/gists{/gist_id}","starred_url":"https://api.github.com/users/pgaubatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgaubatz/subscriptions","organizations_url":"https://api.github.com/users/pgaubatz/orgs","repos_url":"https://api.github.com/users/pgaubatz/repos","events_url":"https://api.github.com/users/pgaubatz/events{/privacy}","received_events_url":"https://api.github.com/users/pgaubatz/received_events","type":"User","site_admin":false},"body":"This change allows for URIs like `sms:?body=hello` to be used and resolves issue #3828.","created_at":"2016-01-03T13:11:34Z","updated_at":"2016-01-15T11:58:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"849a80259385558c95827d32d10ebb88568eb8d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017/commits","review_comments_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017/comments","review_comment_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/5017/comments","statuses_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/statuses/21a3af9371f07e7bec25f2be7a99d23128621ddc","head":{"label":"pgaubatz:fix_sms_uris","ref":"fix_sms_uris","sha":"21a3af9371f07e7bec25f2be7a99d23128621ddc","user":{"login":"pgaubatz","id":103894,"avatar_url":"https://avatars.githubusercontent.com/u/103894?v=3","gravatar_id":"","url":"https://api.github.com/users/pgaubatz","html_url":"https://github.com/pgaubatz","followers_url":"https://api.github.com/users/pgaubatz/followers","following_url":"https://api.github.com/users/pgaubatz/following{/other_user}","gists_url":"https://api.github.com/users/pgaubatz/gists{/gist_id}","starred_url":"https://api.github.com/users/pgaubatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgaubatz/subscriptions","organizations_url":"https://api.github.com/users/pgaubatz/orgs","repos_url":"https://api.github.com/users/pgaubatz/repos","events_url":"https://api.github.com/users/pgaubatz/events{/privacy}","received_events_url":"https://api.github.com/users/pgaubatz/received_events","type":"User","site_admin":false},"repo":{"id":48883262,"name":"Signal-Android","full_name":"pgaubatz/Signal-Android","owner":{"login":"pgaubatz","id":103894,"avatar_url":"https://avatars.githubusercontent.com/u/103894?v=3","gravatar_id":"","url":"https://api.github.com/users/pgaubatz","html_url":"https://github.com/pgaubatz","followers_url":"https://api.github.com/users/pgaubatz/followers","following_url":"https://api.github.com/users/pgaubatz/following{/other_user}","gists_url":"https://api.github.com/users/pgaubatz/gists{/gist_id}","starred_url":"https://api.github.com/users/pgaubatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgaubatz/subscriptions","organizations_url":"https://api.github.com/users/pgaubatz/orgs","repos_url":"https://api.github.com/users/pgaubatz/repos","events_url":"https://api.github.com/users/pgaubatz/events{/privacy}","received_events_url":"https://api.github.com/users/pgaubatz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pgaubatz/Signal-Android","description":"A private messenger for Android.","fork":true,"url":"https://api.github.com/repos/pgaubatz/Signal-Android","forks_url":"https://api.github.com/repos/pgaubatz/Signal-Android/forks","keys_url":"https://api.github.com/repos/pgaubatz/Signal-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pgaubatz/Signal-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pgaubatz/Signal-Android/teams","hooks_url":"https://api.github.com/repos/pgaubatz/Signal-Android/hooks","issue_events_url":"https://api.github.com/repos/pgaubatz/Signal-Android/issues/events{/number}","events_url":"https://api.github.com/repos/pgaubatz/Signal-Android/events","assignees_url":"https://api.github.com/repos/pgaubatz/Signal-Android/assignees{/user}","branches_url":"https://api.github.com/repos/pgaubatz/Signal-Android/branches{/branch}","tags_url":"https://api.github.com/repos/pgaubatz/Signal-Android/tags","blobs_url":"https://api.github.com/repos/pgaubatz/Signal-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pgaubatz/Signal-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pgaubatz/Signal-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pgaubatz/Signal-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pgaubatz/Signal-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/pgaubatz/Signal-Android/languages","stargazers_url":"https://api.github.com/repos/pgaubatz/Signal-Android/stargazers","contributors_url":"https://api.github.com/repos/pgaubatz/Signal-Android/contributors","subscribers_url":"https://api.github.com/repos/pgaubatz/Signal-Android/subscribers","subscription_url":"https://api.github.com/repos/pgaubatz/Signal-Android/subscription","commits_url":"https://api.github.com/repos/pgaubatz/Signal-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pgaubatz/Signal-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pgaubatz/Signal-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pgaubatz/Signal-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pgaubatz/Signal-Android/contents/{+path}","compare_url":"https://api.github.com/repos/pgaubatz/Signal-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pgaubatz/Signal-Android/merges","archive_url":"https://api.github.com/repos/pgaubatz/Signal-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pgaubatz/Signal-Android/downloads","issues_url":"https://api.github.com/repos/pgaubatz/Signal-Android/issues{/number}","pulls_url":"https://api.github.com/repos/pgaubatz/Signal-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/pgaubatz/Signal-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/pgaubatz/Signal-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pgaubatz/Signal-Android/labels{/name}","releases_url":"https://api.github.com/repos/pgaubatz/Signal-Android/releases{/id}","created_at":"2016-01-01T16:36:39Z","updated_at":"2016-01-01T16:36:53Z","pushed_at":"2016-01-03T13:10:49Z","git_url":"git://github.com/pgaubatz/Signal-Android.git","ssh_url":"git@github.com:pgaubatz/Signal-Android.git","clone_url":"https://github.com/pgaubatz/Signal-Android.git","svn_url":"https://github.com/pgaubatz/Signal-Android","homepage":"https://whispersystems.org","size":74940,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WhisperSystems:master","ref":"master","sha":"83ec4e06279f134d82f59ea8c30b5da755644d3b","user":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"repo":{"id":2990192,"name":"Signal-Android","full_name":"WhisperSystems/Signal-Android","owner":{"login":"WhisperSystems","id":702459,"avatar_url":"https://avatars.githubusercontent.com/u/702459?v=3","gravatar_id":"","url":"https://api.github.com/users/WhisperSystems","html_url":"https://github.com/WhisperSystems","followers_url":"https://api.github.com/users/WhisperSystems/followers","following_url":"https://api.github.com/users/WhisperSystems/following{/other_user}","gists_url":"https://api.github.com/users/WhisperSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/WhisperSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhisperSystems/subscriptions","organizations_url":"https://api.github.com/users/WhisperSystems/orgs","repos_url":"https://api.github.com/users/WhisperSystems/repos","events_url":"https://api.github.com/users/WhisperSystems/events{/privacy}","received_events_url":"https://api.github.com/users/WhisperSystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WhisperSystems/Signal-Android","description":"A private messenger for Android.","fork":false,"url":"https://api.github.com/repos/WhisperSystems/Signal-Android","forks_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/forks","keys_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/teams","hooks_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/hooks","issue_events_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/events{/number}","events_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/events","assignees_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/assignees{/user}","branches_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/branches{/branch}","tags_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/tags","blobs_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/languages","stargazers_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/stargazers","contributors_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/contributors","subscribers_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/subscribers","subscription_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/subscription","commits_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/contents/{+path}","compare_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/merges","archive_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/downloads","issues_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues{/number}","pulls_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/labels{/name}","releases_url":"https://api.github.com/repos/WhisperSystems/Signal-Android/releases{/id}","created_at":"2011-12-15T20:01:12Z","updated_at":"2016-01-15T07:40:04Z","pushed_at":"2016-01-14T01:53:35Z","git_url":"git://github.com/WhisperSystems/Signal-Android.git","ssh_url":"git@github.com:WhisperSystems/Signal-Android.git","clone_url":"https://github.com/WhisperSystems/Signal-Android.git","svn_url":"https://github.com/WhisperSystems/Signal-Android","homepage":"https://whispersystems.org","size":100283,"stargazers_count":5453,"watchers_count":5453,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1549,"mirror_url":null,"open_issues_count":594,"forks":1549,"open_issues":594,"watchers":5453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017"},"html":{"href":"https://github.com/WhisperSystems/Signal-Android/pull/5017"},"issue":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/5017"},"comments":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/issues/5017/comments"},"review_comments":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017/comments"},"review_comment":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/pulls/5017/commits"},"statuses":{"href":"https://api.github.com/repos/WhisperSystems/Signal-Android/statuses/21a3af9371f07e7bec25f2be7a99d23128621ddc"}}}}