{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/42987384","id":42987384,"diff_hunk":"@@ -27,12 +43,62 @@ export default class PopoverListMembers extends React.Component {\n             }\n         };\n     }\n+\n+    handleShowDirectChannel(teammate, e) {\n+        e.preventDefault();\n+\n+        const channelName = Utils.getDirectChannelName(UserStore.getCurrentId(), teammate.id);\n+        let channel = ChannelStore.getByName(channelName);\n+\n+        const preference = PreferenceStore.setPreference(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, teammate.id, 'true');\n+        AsyncClient.savePreferences([preference]);\n+\n+        if (channel) {\n+            Utils.switchChannel(channel);\n+            this.closePopover();\n+        } else {\n+            channel = {\n+                name: channelName,\n+                last_post_at: 0,\n+                total_msg_count: 0,\n+                type: 'D',\n+                display_name: teammate.username,\n+                teammate_id: teammate.id,\n+                status: UserStore.getStatus(teammate.id)\n+            };\n+\n+            Client.createDirectChannel(\n+                channel,\n+                teammate.id,\n+                (data) => {\n+                    AsyncClient.getChannel(data.id);\n+                    Utils.switchChannel(data);\n+\n+                    this.closePopover();\n+                },\n+                () => {\n+                    window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/' + channelName;\n+                    this.closePopover();\n+                }\n+            );\n+        }\n+    }\n+\n+    closePopover() {\n+        var overlay = this.refs.overlay;","path":"web/react/components/popover_list_members.jsx","position":71,"original_position":71,"commit_id":"0d8b6e3082aa5cdb6b0f5a2596478128662f2982","original_commit_id":"0d8b6e3082aa5cdb6b0f5a2596478128662f2982","user":{"login":"crspeller","id":3191642,"avatar_url":"https://avatars.githubusercontent.com/u/3191642?v=3","gravatar_id":"","url":"https://api.github.com/users/crspeller","html_url":"https://github.com/crspeller","followers_url":"https://api.github.com/users/crspeller/followers","following_url":"https://api.github.com/users/crspeller/following{/other_user}","gists_url":"https://api.github.com/users/crspeller/gists{/gist_id}","starred_url":"https://api.github.com/users/crspeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crspeller/subscriptions","organizations_url":"https://api.github.com/users/crspeller/orgs","repos_url":"https://api.github.com/users/crspeller/repos","events_url":"https://api.github.com/users/crspeller/events{/privacy}","received_events_url":"https://api.github.com/users/crspeller/received_events","type":"User","site_admin":false},"body":"Instead of refs and calling methods on children, passing props to child components should be used when possible. Here we can use the `show` property of OverlayTrigger and the `onHide` callback to keep the show state up to date. Details can be found here: https://react-bootstrap.github.io/components.html#overlays","created_at":"2015-10-26T12:37:12Z","updated_at":"2015-10-26T12:37:12Z","html_url":"https://github.com/mattermost/platform/pull/1174#discussion_r42987384","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/1174","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/42987384"},"html":{"href":"https://github.com/mattermost/platform/pull/1174#discussion_r42987384"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/1174"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/1174","id":48682196,"html_url":"https://github.com/mattermost/platform/pull/1174","diff_url":"https://github.com/mattermost/platform/pull/1174.diff","patch_url":"https://github.com/mattermost/platform/pull/1174.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/1174","number":1174,"state":"open","locked":false,"title":"Add styling to channel member popover","user":{"login":"florianorben","id":1024005,"avatar_url":"https://avatars.githubusercontent.com/u/1024005?v=3","gravatar_id":"","url":"https://api.github.com/users/florianorben","html_url":"https://github.com/florianorben","followers_url":"https://api.github.com/users/florianorben/followers","following_url":"https://api.github.com/users/florianorben/following{/other_user}","gists_url":"https://api.github.com/users/florianorben/gists{/gist_id}","starred_url":"https://api.github.com/users/florianorben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianorben/subscriptions","organizations_url":"https://api.github.com/users/florianorben/orgs","repos_url":"https://api.github.com/users/florianorben/repos","events_url":"https://api.github.com/users/florianorben/events{/privacy}","received_events_url":"https://api.github.com/users/florianorben/received_events","type":"User","site_admin":false},"body":"I thought the channel member popover was a little lacking in style and functionality - this PR turns this:\r\n![before](https://cloud.githubusercontent.com/assets/1024005/10716668/7bcc1c8a-7b40-11e5-8438-c93c4f5726d7.png)\r\ninto this:\r\n![after](https://cloud.githubusercontent.com/assets/1024005/10716669/7d2663ce-7b40-11e5-8250-63089a8d5ba6.png)\r\n","created_at":"2015-10-25T16:48:55Z","updated_at":"2015-10-26T12:37:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"011716721ac149fbac75573ed19f668d4ab89ffe","assignee":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/1174/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/1174/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/1174/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/0d8b6e3082aa5cdb6b0f5a2596478128662f2982","head":{"label":"florianorben:member-popover","ref":"member-popover","sha":"0d8b6e3082aa5cdb6b0f5a2596478128662f2982","user":{"login":"florianorben","id":1024005,"avatar_url":"https://avatars.githubusercontent.com/u/1024005?v=3","gravatar_id":"","url":"https://api.github.com/users/florianorben","html_url":"https://github.com/florianorben","followers_url":"https://api.github.com/users/florianorben/followers","following_url":"https://api.github.com/users/florianorben/following{/other_user}","gists_url":"https://api.github.com/users/florianorben/gists{/gist_id}","starred_url":"https://api.github.com/users/florianorben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianorben/subscriptions","organizations_url":"https://api.github.com/users/florianorben/orgs","repos_url":"https://api.github.com/users/florianorben/repos","events_url":"https://api.github.com/users/florianorben/events{/privacy}","received_events_url":"https://api.github.com/users/florianorben/received_events","type":"User","site_admin":false},"repo":{"id":44068501,"name":"platform","full_name":"florianorben/platform","owner":{"login":"florianorben","id":1024005,"avatar_url":"https://avatars.githubusercontent.com/u/1024005?v=3","gravatar_id":"","url":"https://api.github.com/users/florianorben","html_url":"https://github.com/florianorben","followers_url":"https://api.github.com/users/florianorben/followers","following_url":"https://api.github.com/users/florianorben/following{/other_user}","gists_url":"https://api.github.com/users/florianorben/gists{/gist_id}","starred_url":"https://api.github.com/users/florianorben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianorben/subscriptions","organizations_url":"https://api.github.com/users/florianorben/orgs","repos_url":"https://api.github.com/users/florianorben/repos","events_url":"https://api.github.com/users/florianorben/events{/privacy}","received_events_url":"https://api.github.com/users/florianorben/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florianorben/platform","description":"Open source Slack-alternative in Golang and React","fork":true,"url":"https://api.github.com/repos/florianorben/platform","forks_url":"https://api.github.com/repos/florianorben/platform/forks","keys_url":"https://api.github.com/repos/florianorben/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florianorben/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florianorben/platform/teams","hooks_url":"https://api.github.com/repos/florianorben/platform/hooks","issue_events_url":"https://api.github.com/repos/florianorben/platform/issues/events{/number}","events_url":"https://api.github.com/repos/florianorben/platform/events","assignees_url":"https://api.github.com/repos/florianorben/platform/assignees{/user}","branches_url":"https://api.github.com/repos/florianorben/platform/branches{/branch}","tags_url":"https://api.github.com/repos/florianorben/platform/tags","blobs_url":"https://api.github.com/repos/florianorben/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florianorben/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florianorben/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/florianorben/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florianorben/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/florianorben/platform/languages","stargazers_url":"https://api.github.com/repos/florianorben/platform/stargazers","contributors_url":"https://api.github.com/repos/florianorben/platform/contributors","subscribers_url":"https://api.github.com/repos/florianorben/platform/subscribers","subscription_url":"https://api.github.com/repos/florianorben/platform/subscription","commits_url":"https://api.github.com/repos/florianorben/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/florianorben/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/florianorben/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/florianorben/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/florianorben/platform/contents/{+path}","compare_url":"https://api.github.com/repos/florianorben/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florianorben/platform/merges","archive_url":"https://api.github.com/repos/florianorben/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florianorben/platform/downloads","issues_url":"https://api.github.com/repos/florianorben/platform/issues{/number}","pulls_url":"https://api.github.com/repos/florianorben/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/florianorben/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/florianorben/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florianorben/platform/labels{/name}","releases_url":"https://api.github.com/repos/florianorben/platform/releases{/id}","created_at":"2015-10-11T20:32:07Z","updated_at":"2015-10-11T20:32:11Z","pushed_at":"2015-10-26T01:24:52Z","git_url":"git://github.com/florianorben/platform.git","ssh_url":"git@github.com:florianorben/platform.git","clone_url":"https://github.com/florianorben/platform.git","svn_url":"https://github.com/florianorben/platform","homepage":"http://mattermost.org","size":17324,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mattermost:master","ref":"master","sha":"dc439fd7e84d54a95f6c0ac2b51a21e634777436","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":37448451,"name":"platform","full_name":"mattermost/platform","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/platform","description":"Open source Slack-alternative in Golang and React","fork":false,"url":"https://api.github.com/repos/mattermost/platform","forks_url":"https://api.github.com/repos/mattermost/platform/forks","keys_url":"https://api.github.com/repos/mattermost/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/platform/teams","hooks_url":"https://api.github.com/repos/mattermost/platform/hooks","issue_events_url":"https://api.github.com/repos/mattermost/platform/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/platform/events","assignees_url":"https://api.github.com/repos/mattermost/platform/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/platform/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/platform/tags","blobs_url":"https://api.github.com/repos/mattermost/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/platform/languages","stargazers_url":"https://api.github.com/repos/mattermost/platform/stargazers","contributors_url":"https://api.github.com/repos/mattermost/platform/contributors","subscribers_url":"https://api.github.com/repos/mattermost/platform/subscribers","subscription_url":"https://api.github.com/repos/mattermost/platform/subscription","commits_url":"https://api.github.com/repos/mattermost/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/platform/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/platform/merges","archive_url":"https://api.github.com/repos/mattermost/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/platform/downloads","issues_url":"https://api.github.com/repos/mattermost/platform/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/platform/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/platform/releases{/id}","created_at":"2015-06-15T06:50:02Z","updated_at":"2015-10-26T11:26:56Z","pushed_at":"2015-10-26T12:20:45Z","git_url":"git://github.com/mattermost/platform.git","ssh_url":"git@github.com:mattermost/platform.git","clone_url":"https://github.com/mattermost/platform.git","svn_url":"https://github.com/mattermost/platform","homepage":"http://mattermost.org","size":28785,"stargazers_count":5209,"watchers_count":5209,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":416,"mirror_url":null,"open_issues_count":64,"forks":416,"open_issues":64,"watchers":5209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/1174"},"html":{"href":"https://github.com/mattermost/platform/pull/1174"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/1174"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/1174/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/1174/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/1174/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/0d8b6e3082aa5cdb6b0f5a2596478128662f2982"}}}}