{"action":"created","comment":{"url":"https://api.github.com/repos/i3/i3status/pulls/comments/78634157","id":78634157,"diff_hunk":"@@ -88,20 +95,22 @@ static void store_volume_from_sink_cb(pa_context *c,\n      * DEFAULT_SINK_INDEX as the index, and another with its proper value\n      * (using bitwise OR to avoid early-out logic) */\n     if ((info->index == default_sink_idx &&\n-         save_volume(DEFAULT_SINK_INDEX, composed_volume)) |\n-        save_volume(info->index, composed_volume)) {\n+         save_volume(DEFAULT_SINK_INDEX, composed_volume, NULL)) |\n+        save_volume(info->index, composed_volume, info->name)) {\n         /* if the volume or mute flag changed, wake the main thread */\n         pthread_kill(main_thread, SIGUSR1);\n     }\n }\n \n-static void get_sink_info(pa_context *c, uint32_t idx) {\n+static void get_sink_info(pa_context *c, uint32_t idx, const char *name) {\n     pa_operation *o =\n-        idx == DEFAULT_SINK_INDEX ? pa_context_get_sink_info_by_name(\n-                                        c, \"@DEFAULT_SINK@\", store_volume_from_sink_cb, NULL)\n-                                  : pa_context_get_sink_info_by_index(\n-                                        c, idx, store_volume_from_sink_cb, NULL);\n-    pulseaudio_free_operation(c, o);\n+        name || idx == DEFAULT_SINK_INDEX ? pa_context_get_sink_info_by_name(","path":"src/pulse.c","position":56,"original_position":56,"commit_id":"e1899ff4f2ae8b4275d502009eb76d32599af99b","original_commit_id":"e1899ff4f2ae8b4275d502009eb76d32599af99b","user":{"login":"stapelberg","id":55506,"avatar_url":"https://avatars.githubusercontent.com/u/55506?v=3","gravatar_id":"","url":"https://api.github.com/users/stapelberg","html_url":"https://github.com/stapelberg","followers_url":"https://api.github.com/users/stapelberg/followers","following_url":"https://api.github.com/users/stapelberg/following{/other_user}","gists_url":"https://api.github.com/users/stapelberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stapelberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stapelberg/subscriptions","organizations_url":"https://api.github.com/users/stapelberg/orgs","repos_url":"https://api.github.com/users/stapelberg/repos","events_url":"https://api.github.com/users/stapelberg/events{/privacy}","received_events_url":"https://api.github.com/users/stapelberg/received_events","type":"User","site_admin":false},"body":"Could you refactor this nested ternary operator conditional into a couple of if statements please? I think that’d be easier to read bottom line.","created_at":"2016-09-13T20:08:01Z","updated_at":"2016-09-13T20:08:01Z","html_url":"https://github.com/i3/i3status/pull/162#discussion_r78634157","pull_request_url":"https://api.github.com/repos/i3/i3status/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/i3/i3status/pulls/comments/78634157"},"html":{"href":"https://github.com/i3/i3status/pull/162#discussion_r78634157"},"pull_request":{"href":"https://api.github.com/repos/i3/i3status/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/i3/i3status/pulls/162","id":84916614,"html_url":"https://github.com/i3/i3status/pull/162","diff_url":"https://github.com/i3/i3status/pull/162.diff","patch_url":"https://github.com/i3/i3status/pull/162.patch","issue_url":"https://api.github.com/repos/i3/i3status/issues/162","number":162,"state":"open","locked":false,"title":"Pulse device may be specified by name (#126)","user":{"login":"Watcom","id":1391264,"avatar_url":"https://avatars.githubusercontent.com/u/1391264?v=3","gravatar_id":"","url":"https://api.github.com/users/Watcom","html_url":"https://github.com/Watcom","followers_url":"https://api.github.com/users/Watcom/followers","following_url":"https://api.github.com/users/Watcom/following{/other_user}","gists_url":"https://api.github.com/users/Watcom/gists{/gist_id}","starred_url":"https://api.github.com/users/Watcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Watcom/subscriptions","organizations_url":"https://api.github.com/users/Watcom/orgs","repos_url":"https://api.github.com/users/Watcom/repos","events_url":"https://api.github.com/users/Watcom/events{/privacy}","received_events_url":"https://api.github.com/users/Watcom/received_events","type":"User","site_admin":false},"body":"Implements #126 \r\nUsing the default sink (by not specifying a sink) still works as before, i.e., if you change the default sink from device A to device B it changes the volume displayed to device B. On any other situation (if you specify the sink by id or name), it should follow that device even if it changes sink id. Of course if you specify by id it won't survive an i3status restart, so specifying the sink by name is better.","created_at":"2016-09-12T18:04:20Z","updated_at":"2016-09-13T20:08:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91652ee2585f5a8247e274857500a2ad808a023f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/i3/i3status/pulls/162/commits","review_comments_url":"https://api.github.com/repos/i3/i3status/pulls/162/comments","review_comment_url":"https://api.github.com/repos/i3/i3status/pulls/comments{/number}","comments_url":"https://api.github.com/repos/i3/i3status/issues/162/comments","statuses_url":"https://api.github.com/repos/i3/i3status/statuses/e1899ff4f2ae8b4275d502009eb76d32599af99b","head":{"label":"Watcom:master","ref":"master","sha":"e1899ff4f2ae8b4275d502009eb76d32599af99b","user":{"login":"Watcom","id":1391264,"avatar_url":"https://avatars.githubusercontent.com/u/1391264?v=3","gravatar_id":"","url":"https://api.github.com/users/Watcom","html_url":"https://github.com/Watcom","followers_url":"https://api.github.com/users/Watcom/followers","following_url":"https://api.github.com/users/Watcom/following{/other_user}","gists_url":"https://api.github.com/users/Watcom/gists{/gist_id}","starred_url":"https://api.github.com/users/Watcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Watcom/subscriptions","organizations_url":"https://api.github.com/users/Watcom/orgs","repos_url":"https://api.github.com/users/Watcom/repos","events_url":"https://api.github.com/users/Watcom/events{/privacy}","received_events_url":"https://api.github.com/users/Watcom/received_events","type":"User","site_admin":false},"repo":{"id":31743988,"name":"i3status","full_name":"Watcom/i3status","owner":{"login":"Watcom","id":1391264,"avatar_url":"https://avatars.githubusercontent.com/u/1391264?v=3","gravatar_id":"","url":"https://api.github.com/users/Watcom","html_url":"https://github.com/Watcom","followers_url":"https://api.github.com/users/Watcom/followers","following_url":"https://api.github.com/users/Watcom/following{/other_user}","gists_url":"https://api.github.com/users/Watcom/gists{/gist_id}","starred_url":"https://api.github.com/users/Watcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Watcom/subscriptions","organizations_url":"https://api.github.com/users/Watcom/orgs","repos_url":"https://api.github.com/users/Watcom/repos","events_url":"https://api.github.com/users/Watcom/events{/privacy}","received_events_url":"https://api.github.com/users/Watcom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Watcom/i3status","description":"Generates status bar to use with i3bar, dzen2 or xmobar","fork":true,"url":"https://api.github.com/repos/Watcom/i3status","forks_url":"https://api.github.com/repos/Watcom/i3status/forks","keys_url":"https://api.github.com/repos/Watcom/i3status/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Watcom/i3status/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Watcom/i3status/teams","hooks_url":"https://api.github.com/repos/Watcom/i3status/hooks","issue_events_url":"https://api.github.com/repos/Watcom/i3status/issues/events{/number}","events_url":"https://api.github.com/repos/Watcom/i3status/events","assignees_url":"https://api.github.com/repos/Watcom/i3status/assignees{/user}","branches_url":"https://api.github.com/repos/Watcom/i3status/branches{/branch}","tags_url":"https://api.github.com/repos/Watcom/i3status/tags","blobs_url":"https://api.github.com/repos/Watcom/i3status/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Watcom/i3status/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Watcom/i3status/git/refs{/sha}","trees_url":"https://api.github.com/repos/Watcom/i3status/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Watcom/i3status/statuses/{sha}","languages_url":"https://api.github.com/repos/Watcom/i3status/languages","stargazers_url":"https://api.github.com/repos/Watcom/i3status/stargazers","contributors_url":"https://api.github.com/repos/Watcom/i3status/contributors","subscribers_url":"https://api.github.com/repos/Watcom/i3status/subscribers","subscription_url":"https://api.github.com/repos/Watcom/i3status/subscription","commits_url":"https://api.github.com/repos/Watcom/i3status/commits{/sha}","git_commits_url":"https://api.github.com/repos/Watcom/i3status/git/commits{/sha}","comments_url":"https://api.github.com/repos/Watcom/i3status/comments{/number}","issue_comment_url":"https://api.github.com/repos/Watcom/i3status/issues/comments{/number}","contents_url":"https://api.github.com/repos/Watcom/i3status/contents/{+path}","compare_url":"https://api.github.com/repos/Watcom/i3status/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Watcom/i3status/merges","archive_url":"https://api.github.com/repos/Watcom/i3status/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Watcom/i3status/downloads","issues_url":"https://api.github.com/repos/Watcom/i3status/issues{/number}","pulls_url":"https://api.github.com/repos/Watcom/i3status/pulls{/number}","milestones_url":"https://api.github.com/repos/Watcom/i3status/milestones{/number}","notifications_url":"https://api.github.com/repos/Watcom/i3status/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Watcom/i3status/labels{/name}","releases_url":"https://api.github.com/repos/Watcom/i3status/releases{/id}","deployments_url":"https://api.github.com/repos/Watcom/i3status/deployments","created_at":"2015-03-06T00:17:16Z","updated_at":"2016-01-12T12:58:05Z","pushed_at":"2016-09-12T18:16:28Z","git_url":"git://github.com/Watcom/i3status.git","ssh_url":"git@github.com:Watcom/i3status.git","clone_url":"https://github.com/Watcom/i3status.git","svn_url":"https://github.com/Watcom/i3status","homepage":null,"size":541,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"i3:master","ref":"master","sha":"48e10658b46e07b89ee7074af1a56bdc61656f05","user":{"login":"i3","id":7904352,"avatar_url":"https://avatars.githubusercontent.com/u/7904352?v=3","gravatar_id":"","url":"https://api.github.com/users/i3","html_url":"https://github.com/i3","followers_url":"https://api.github.com/users/i3/followers","following_url":"https://api.github.com/users/i3/following{/other_user}","gists_url":"https://api.github.com/users/i3/gists{/gist_id}","starred_url":"https://api.github.com/users/i3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i3/subscriptions","organizations_url":"https://api.github.com/users/i3/orgs","repos_url":"https://api.github.com/users/i3/repos","events_url":"https://api.github.com/users/i3/events{/privacy}","received_events_url":"https://api.github.com/users/i3/received_events","type":"Organization","site_admin":false},"repo":{"id":28519975,"name":"i3status","full_name":"i3/i3status","owner":{"login":"i3","id":7904352,"avatar_url":"https://avatars.githubusercontent.com/u/7904352?v=3","gravatar_id":"","url":"https://api.github.com/users/i3","html_url":"https://github.com/i3","followers_url":"https://api.github.com/users/i3/followers","following_url":"https://api.github.com/users/i3/following{/other_user}","gists_url":"https://api.github.com/users/i3/gists{/gist_id}","starred_url":"https://api.github.com/users/i3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i3/subscriptions","organizations_url":"https://api.github.com/users/i3/orgs","repos_url":"https://api.github.com/users/i3/repos","events_url":"https://api.github.com/users/i3/events{/privacy}","received_events_url":"https://api.github.com/users/i3/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/i3/i3status","description":"Generates status bar to use with i3bar, dzen2 or xmobar","fork":false,"url":"https://api.github.com/repos/i3/i3status","forks_url":"https://api.github.com/repos/i3/i3status/forks","keys_url":"https://api.github.com/repos/i3/i3status/keys{/key_id}","collaborators_url":"https://api.github.com/repos/i3/i3status/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/i3/i3status/teams","hooks_url":"https://api.github.com/repos/i3/i3status/hooks","issue_events_url":"https://api.github.com/repos/i3/i3status/issues/events{/number}","events_url":"https://api.github.com/repos/i3/i3status/events","assignees_url":"https://api.github.com/repos/i3/i3status/assignees{/user}","branches_url":"https://api.github.com/repos/i3/i3status/branches{/branch}","tags_url":"https://api.github.com/repos/i3/i3status/tags","blobs_url":"https://api.github.com/repos/i3/i3status/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/i3/i3status/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/i3/i3status/git/refs{/sha}","trees_url":"https://api.github.com/repos/i3/i3status/git/trees{/sha}","statuses_url":"https://api.github.com/repos/i3/i3status/statuses/{sha}","languages_url":"https://api.github.com/repos/i3/i3status/languages","stargazers_url":"https://api.github.com/repos/i3/i3status/stargazers","contributors_url":"https://api.github.com/repos/i3/i3status/contributors","subscribers_url":"https://api.github.com/repos/i3/i3status/subscribers","subscription_url":"https://api.github.com/repos/i3/i3status/subscription","commits_url":"https://api.github.com/repos/i3/i3status/commits{/sha}","git_commits_url":"https://api.github.com/repos/i3/i3status/git/commits{/sha}","comments_url":"https://api.github.com/repos/i3/i3status/comments{/number}","issue_comment_url":"https://api.github.com/repos/i3/i3status/issues/comments{/number}","contents_url":"https://api.github.com/repos/i3/i3status/contents/{+path}","compare_url":"https://api.github.com/repos/i3/i3status/compare/{base}...{head}","merges_url":"https://api.github.com/repos/i3/i3status/merges","archive_url":"https://api.github.com/repos/i3/i3status/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/i3/i3status/downloads","issues_url":"https://api.github.com/repos/i3/i3status/issues{/number}","pulls_url":"https://api.github.com/repos/i3/i3status/pulls{/number}","milestones_url":"https://api.github.com/repos/i3/i3status/milestones{/number}","notifications_url":"https://api.github.com/repos/i3/i3status/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/i3/i3status/labels{/name}","releases_url":"https://api.github.com/repos/i3/i3status/releases{/id}","deployments_url":"https://api.github.com/repos/i3/i3status/deployments","created_at":"2014-12-26T20:04:55Z","updated_at":"2016-09-10T17:32:48Z","pushed_at":"2016-09-12T18:16:28Z","git_url":"git://github.com/i3/i3status.git","ssh_url":"git@github.com:i3/i3status.git","clone_url":"https://github.com/i3/i3status.git","svn_url":"https://github.com/i3/i3status","homepage":null,"size":770,"stargazers_count":118,"watchers_count":118,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":93,"mirror_url":null,"open_issues_count":18,"forks":93,"open_issues":18,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/i3/i3status/pulls/162"},"html":{"href":"https://github.com/i3/i3status/pull/162"},"issue":{"href":"https://api.github.com/repos/i3/i3status/issues/162"},"comments":{"href":"https://api.github.com/repos/i3/i3status/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/i3/i3status/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/i3/i3status/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/i3/i3status/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/i3/i3status/statuses/e1899ff4f2ae8b4275d502009eb76d32599af99b"}}}}
{"actor":{"display_login":"stapelberg"}}