{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/64562039","id":64562039,"diff_hunk":"@@ -6,43 +6,65 @@ import React from 'react';\n import Constants from 'utils/constants.jsx';\n import ChannelStore from 'stores/channel_store.jsx';\n import * as Utils from 'utils/utils.jsx';\n+import * as AsyncClient from 'utils/async_client.jsx';\n \n export default class ChannelSelect extends React.Component {\n     static get propTypes() {\n         return {\n             onChange: React.PropTypes.func,\n-            value: React.PropTypes.string\n+            value: React.PropTypes.string,\n+            selectOpen: React.PropTypes.bool.isRequired,\n+            selectPrivate: React.PropTypes.bool.isRequired,\n+            selectDm: React.PropTypes.bool.isRequired\n         };\n     }\n \n     constructor(props) {\n         super(props);\n \n         this.handleChannelChange = this.handleChannelChange.bind(this);\n+        this.onListenerChange = this.onListenerChange.bind(this);\n+        this.compareByDisplayName = this.compareByDisplayName.bind(this);\n \n         this.state = {\n             channels: []\n         };\n     }\n \n     componentWillMount() {\n+        ChannelStore.addMoreChangeListener(this.onListenerChange);\n+        AsyncClient.getMoreChannels(true);\n         this.setState({\n-            channels: ChannelStore.getAll()\n+            channels: ChannelStore.getAll().sort(this.compareByDisplayName)\n         });\n \n         ChannelStore.addChangeListener(this.handleChannelChange);\n     }\n \n     componentWillUnmount() {\n         ChannelStore.removeChangeListener(this.handleChannelChange);\n+        ChannelStore.removeMoreChangeListener(this.onListenerChange);\n+    }\n+\n+    onListenerChange() {\n+        var newState = {\n+            channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).sort(this.compareByDisplayName)\n+        };\n+        if (!Utils.areObjectsEqual(newState.channels, this.state.channels)) {\n+            this.setState(newState);\n+        }\n     }\n \n     handleChannelChange() {\n         this.setState({\n-            channels: ChannelStore.getAll()\n+            channels: ChannelStore.getAll().concat(ChannelStore.getMoreAll()).sort(this.compareByDisplayName)\n         });\n     }\n \n+    compareByDisplayName(a, b) {","path":"webapp/components/channel_select.jsx","position":62,"original_position":62,"commit_id":"ca390d1c846e3aeeee199aff6d042319e0f8fb65","original_commit_id":"ca390d1c846e3aeeee199aff6d042319e0f8fb65","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":"Compare what by display name? The argument names of `a` and `b` certainly don't help. ","created_at":"2016-05-25T12:22:24Z","updated_at":"2016-05-25T12:22:24Z","html_url":"https://github.com/mattermost/platform/pull/3082#discussion_r64562039","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/3082","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/64562039"},"html":{"href":"https://github.com/mattermost/platform/pull/3082#discussion_r64562039"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/3082"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/3082","id":70990729,"html_url":"https://github.com/mattermost/platform/pull/3082","diff_url":"https://github.com/mattermost/platform/pull/3082.diff","patch_url":"https://github.com/mattermost/platform/pull/3082.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/3082","number":3082,"state":"open","locked":false,"title":"PLT-2989 Incoming Webhooks are only available in Public Channels users belong to","user":{"login":"DavidLu1997","id":5740966,"avatar_url":"https://avatars.githubusercontent.com/u/5740966?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidLu1997","html_url":"https://github.com/DavidLu1997","followers_url":"https://api.github.com/users/DavidLu1997/followers","following_url":"https://api.github.com/users/DavidLu1997/following{/other_user}","gists_url":"https://api.github.com/users/DavidLu1997/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidLu1997/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidLu1997/subscriptions","organizations_url":"https://api.github.com/users/DavidLu1997/orgs","repos_url":"https://api.github.com/users/DavidLu1997/repos","events_url":"https://api.github.com/users/DavidLu1997/events{/privacy}","received_events_url":"https://api.github.com/users/DavidLu1997/received_events","type":"User","site_admin":false},"body":"Removed the check for OPEN_CHANNEL, now incoming/outgoing webhooks can be directed at any channel that is not a DM channel.\r\n\r\nCan also change the check to allow DM channels.","created_at":"2016-05-22T22:36:24Z","updated_at":"2016-05-25T12:22:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9819979348f923b7d9abb950115fd9384daa425b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/3082/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/3082/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/3082/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/ca390d1c846e3aeeee199aff6d042319e0f8fb65","head":{"label":"DavidLu1997:plt-2998","ref":"plt-2998","sha":"ca390d1c846e3aeeee199aff6d042319e0f8fb65","user":{"login":"DavidLu1997","id":5740966,"avatar_url":"https://avatars.githubusercontent.com/u/5740966?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidLu1997","html_url":"https://github.com/DavidLu1997","followers_url":"https://api.github.com/users/DavidLu1997/followers","following_url":"https://api.github.com/users/DavidLu1997/following{/other_user}","gists_url":"https://api.github.com/users/DavidLu1997/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidLu1997/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidLu1997/subscriptions","organizations_url":"https://api.github.com/users/DavidLu1997/orgs","repos_url":"https://api.github.com/users/DavidLu1997/repos","events_url":"https://api.github.com/users/DavidLu1997/events{/privacy}","received_events_url":"https://api.github.com/users/DavidLu1997/received_events","type":"User","site_admin":false},"repo":{"id":58471803,"name":"platform","full_name":"DavidLu1997/platform","owner":{"login":"DavidLu1997","id":5740966,"avatar_url":"https://avatars.githubusercontent.com/u/5740966?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidLu1997","html_url":"https://github.com/DavidLu1997","followers_url":"https://api.github.com/users/DavidLu1997/followers","following_url":"https://api.github.com/users/DavidLu1997/following{/other_user}","gists_url":"https://api.github.com/users/DavidLu1997/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidLu1997/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidLu1997/subscriptions","organizations_url":"https://api.github.com/users/DavidLu1997/orgs","repos_url":"https://api.github.com/users/DavidLu1997/repos","events_url":"https://api.github.com/users/DavidLu1997/events{/privacy}","received_events_url":"https://api.github.com/users/DavidLu1997/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DavidLu1997/platform","description":"Open source Slack-alternative in Golang and React - Mattermost","fork":true,"url":"https://api.github.com/repos/DavidLu1997/platform","forks_url":"https://api.github.com/repos/DavidLu1997/platform/forks","keys_url":"https://api.github.com/repos/DavidLu1997/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DavidLu1997/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DavidLu1997/platform/teams","hooks_url":"https://api.github.com/repos/DavidLu1997/platform/hooks","issue_events_url":"https://api.github.com/repos/DavidLu1997/platform/issues/events{/number}","events_url":"https://api.github.com/repos/DavidLu1997/platform/events","assignees_url":"https://api.github.com/repos/DavidLu1997/platform/assignees{/user}","branches_url":"https://api.github.com/repos/DavidLu1997/platform/branches{/branch}","tags_url":"https://api.github.com/repos/DavidLu1997/platform/tags","blobs_url":"https://api.github.com/repos/DavidLu1997/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DavidLu1997/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DavidLu1997/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/DavidLu1997/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DavidLu1997/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/DavidLu1997/platform/languages","stargazers_url":"https://api.github.com/repos/DavidLu1997/platform/stargazers","contributors_url":"https://api.github.com/repos/DavidLu1997/platform/contributors","subscribers_url":"https://api.github.com/repos/DavidLu1997/platform/subscribers","subscription_url":"https://api.github.com/repos/DavidLu1997/platform/subscription","commits_url":"https://api.github.com/repos/DavidLu1997/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/DavidLu1997/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/DavidLu1997/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/DavidLu1997/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/DavidLu1997/platform/contents/{+path}","compare_url":"https://api.github.com/repos/DavidLu1997/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DavidLu1997/platform/merges","archive_url":"https://api.github.com/repos/DavidLu1997/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DavidLu1997/platform/downloads","issues_url":"https://api.github.com/repos/DavidLu1997/platform/issues{/number}","pulls_url":"https://api.github.com/repos/DavidLu1997/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/DavidLu1997/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/DavidLu1997/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DavidLu1997/platform/labels{/name}","releases_url":"https://api.github.com/repos/DavidLu1997/platform/releases{/id}","deployments_url":"https://api.github.com/repos/DavidLu1997/platform/deployments","created_at":"2016-05-10T15:14:29Z","updated_at":"2016-05-10T15:14:32Z","pushed_at":"2016-05-24T21:53:13Z","git_url":"git://github.com/DavidLu1997/platform.git","ssh_url":"git@github.com:DavidLu1997/platform.git","clone_url":"https://github.com/DavidLu1997/platform.git","svn_url":"https://github.com/DavidLu1997/platform","homepage":"http://mattermost.org","size":47916,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mattermost:master","ref":"master","sha":"e81fa3220de51350592e50b2fa3e0dc9425d43f8","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 - Mattermost","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}","deployments_url":"https://api.github.com/repos/mattermost/platform/deployments","created_at":"2015-06-15T06:50:02Z","updated_at":"2016-05-25T11:22:53Z","pushed_at":"2016-05-25T12:19:55Z","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":55022,"stargazers_count":8003,"watchers_count":8003,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":872,"mirror_url":null,"open_issues_count":42,"forks":872,"open_issues":42,"watchers":8003,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/3082"},"html":{"href":"https://github.com/mattermost/platform/pull/3082"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/3082"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/3082/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/3082/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/3082/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/ca390d1c846e3aeeee199aff6d042319e0f8fb65"}}}}
{"actor":{"display_login":"crspeller"}}