{"action":"created","comment":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/177646738","pull_request_review_id":107553919,"id":177646738,"diff_hunk":"@@ -63,12 +63,12 @@ function scrollIntoViewNicely(el) {\n \n function collapse() {\n \t$(\".chan.active .toggle-button.toggle-preview.opened\").click();\n-\treturn true;\n+\treturn \"\";","path":"client/js/utils.js","position":5,"original_position":5,"commit_id":"4337b33869ed3c656f1dff6e70b3309dee4697eb","original_commit_id":"4337b33869ed3c656f1dff6e70b3309dee4697eb","user":{"login":"astorije","id":113730,"avatar_url":"https://avatars1.githubusercontent.com/u/113730?v=4","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"body":"Sorry, I didn't see @xPaw's answer earlier. It's honestly very weird. `collapse()` and `expand()` should really not return anything.\r\n\r\nIt's bizarre right now, because we have 3 commands including 2 that do not go to the server, and the third one returns a string, so we have them all return a string, then check if output is a string and if the string is empty...\r\n\r\nI suggest removing the return values from both `expand` and `collapse` functions. Then your code above could be:\r\n\r\n```js\r\nif (typeof utils.inputCommands[cmd] === \"function\") {\r\n\tconst output = utils.inputCommands[cmd](args);\r\n\r\n\tif (output === undefined) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\ttext = output;\r\n}\r\n```\r\n\r\nWould this work? I feel like it wouldn't because of the other branch in `join` (when L75 of this file is `undefined`).","created_at":"2018-03-28T06:13:36Z","updated_at":"2018-03-28T06:13:36Z","html_url":"https://github.com/thelounge/thelounge/pull/2281#discussion_r177646738","pull_request_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2281","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments/177646738"},"html":{"href":"https://github.com/thelounge/thelounge/pull/2281#discussion_r177646738"},"pull_request":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2281"}},"in_reply_to_id":176901712},"pull_request":{"url":"https://api.github.com/repos/thelounge/thelounge/pulls/2281","id":176974049,"html_url":"https://github.com/thelounge/thelounge/pull/2281","diff_url":"https://github.com/thelounge/thelounge/pull/2281.diff","patch_url":"https://github.com/thelounge/thelounge/pull/2281.patch","issue_url":"https://api.github.com/repos/thelounge/thelounge/issues/2281","number":2281,"state":"open","locked":false,"title":"Allow /join to assume channel name as open channel","user":{"login":"MaxLeiter","id":8675906,"avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"body":"Closes #2266","created_at":"2018-03-23T05:00:16Z","updated_at":"2018-03-28T06:13:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05250b345d8a12bc874d90472c5e36c69673cf00","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":323424562,"url":"https://api.github.com/repos/thelounge/thelounge/labels/Type:%20Feature","name":"Type: Feature","color":"86c5f9","default":false}],"milestone":{"url":"https://api.github.com/repos/thelounge/thelounge/milestones/28","html_url":"https://github.com/thelounge/thelounge/milestone/28","labels_url":"https://api.github.com/repos/thelounge/thelounge/milestones/28/labels","id":2803396,"number":28,"title":"3.0.0","description":"","creator":{"login":"astorije","id":113730,"avatar_url":"https://avatars1.githubusercontent.com/u/113730?v=4","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":243,"state":"open","created_at":"2017-09-29T17:49:11Z","updated_at":"2018-03-27T23:29:55Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2281/commits","review_comments_url":"https://api.github.com/repos/thelounge/thelounge/pulls/2281/comments","review_comment_url":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thelounge/thelounge/issues/2281/comments","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/4337b33869ed3c656f1dff6e70b3309dee4697eb","head":{"label":"MaxLeiter:join","ref":"join","sha":"4337b33869ed3c656f1dff6e70b3309dee4697eb","user":{"login":"MaxLeiter","id":8675906,"avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"repo":{"id":51672528,"name":"lounge","full_name":"MaxLeiter/lounge","owner":{"login":"MaxLeiter","id":8675906,"avatar_url":"https://avatars3.githubusercontent.com/u/8675906?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxLeiter","html_url":"https://github.com/MaxLeiter","followers_url":"https://api.github.com/users/MaxLeiter/followers","following_url":"https://api.github.com/users/MaxLeiter/following{/other_user}","gists_url":"https://api.github.com/users/MaxLeiter/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxLeiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxLeiter/subscriptions","organizations_url":"https://api.github.com/users/MaxLeiter/orgs","repos_url":"https://api.github.com/users/MaxLeiter/repos","events_url":"https://api.github.com/users/MaxLeiter/events{/privacy}","received_events_url":"https://api.github.com/users/MaxLeiter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaxLeiter/lounge","description":"The Lounge — Self-hosted web IRC client","fork":true,"url":"https://api.github.com/repos/MaxLeiter/lounge","forks_url":"https://api.github.com/repos/MaxLeiter/lounge/forks","keys_url":"https://api.github.com/repos/MaxLeiter/lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaxLeiter/lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaxLeiter/lounge/teams","hooks_url":"https://api.github.com/repos/MaxLeiter/lounge/hooks","issue_events_url":"https://api.github.com/repos/MaxLeiter/lounge/issues/events{/number}","events_url":"https://api.github.com/repos/MaxLeiter/lounge/events","assignees_url":"https://api.github.com/repos/MaxLeiter/lounge/assignees{/user}","branches_url":"https://api.github.com/repos/MaxLeiter/lounge/branches{/branch}","tags_url":"https://api.github.com/repos/MaxLeiter/lounge/tags","blobs_url":"https://api.github.com/repos/MaxLeiter/lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaxLeiter/lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaxLeiter/lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaxLeiter/lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaxLeiter/lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/MaxLeiter/lounge/languages","stargazers_url":"https://api.github.com/repos/MaxLeiter/lounge/stargazers","contributors_url":"https://api.github.com/repos/MaxLeiter/lounge/contributors","subscribers_url":"https://api.github.com/repos/MaxLeiter/lounge/subscribers","subscription_url":"https://api.github.com/repos/MaxLeiter/lounge/subscription","commits_url":"https://api.github.com/repos/MaxLeiter/lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaxLeiter/lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaxLeiter/lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaxLeiter/lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaxLeiter/lounge/contents/{+path}","compare_url":"https://api.github.com/repos/MaxLeiter/lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaxLeiter/lounge/merges","archive_url":"https://api.github.com/repos/MaxLeiter/lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaxLeiter/lounge/downloads","issues_url":"https://api.github.com/repos/MaxLeiter/lounge/issues{/number}","pulls_url":"https://api.github.com/repos/MaxLeiter/lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/MaxLeiter/lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/MaxLeiter/lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaxLeiter/lounge/labels{/name}","releases_url":"https://api.github.com/repos/MaxLeiter/lounge/releases{/id}","deployments_url":"https://api.github.com/repos/MaxLeiter/lounge/deployments","created_at":"2016-02-14T00:28:27Z","updated_at":"2018-03-28T04:37:12Z","pushed_at":"2018-03-28T04:37:11Z","git_url":"git://github.com/MaxLeiter/lounge.git","ssh_url":"git@github.com:MaxLeiter/lounge.git","clone_url":"https://github.com/MaxLeiter/lounge.git","svn_url":"https://github.com/MaxLeiter/lounge","homepage":"https://thelounge.github.io","size":12339,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thelounge:master","ref":"master","sha":"3afc38efcbf95430e81ce6e4718ada7253c6e2b6","user":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"repo":{"id":51344082,"name":"thelounge","full_name":"thelounge/thelounge","owner":{"login":"thelounge","id":14336958,"avatar_url":"https://avatars1.githubusercontent.com/u/14336958?v=4","gravatar_id":"","url":"https://api.github.com/users/thelounge","html_url":"https://github.com/thelounge","followers_url":"https://api.github.com/users/thelounge/followers","following_url":"https://api.github.com/users/thelounge/following{/other_user}","gists_url":"https://api.github.com/users/thelounge/gists{/gist_id}","starred_url":"https://api.github.com/users/thelounge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelounge/subscriptions","organizations_url":"https://api.github.com/users/thelounge/orgs","repos_url":"https://api.github.com/users/thelounge/repos","events_url":"https://api.github.com/users/thelounge/events{/privacy}","received_events_url":"https://api.github.com/users/thelounge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelounge/thelounge","description":"💬 The Lounge — Modern self-hosted web IRC client","fork":false,"url":"https://api.github.com/repos/thelounge/thelounge","forks_url":"https://api.github.com/repos/thelounge/thelounge/forks","keys_url":"https://api.github.com/repos/thelounge/thelounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelounge/thelounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelounge/thelounge/teams","hooks_url":"https://api.github.com/repos/thelounge/thelounge/hooks","issue_events_url":"https://api.github.com/repos/thelounge/thelounge/issues/events{/number}","events_url":"https://api.github.com/repos/thelounge/thelounge/events","assignees_url":"https://api.github.com/repos/thelounge/thelounge/assignees{/user}","branches_url":"https://api.github.com/repos/thelounge/thelounge/branches{/branch}","tags_url":"https://api.github.com/repos/thelounge/thelounge/tags","blobs_url":"https://api.github.com/repos/thelounge/thelounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelounge/thelounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelounge/thelounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelounge/thelounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelounge/thelounge/statuses/{sha}","languages_url":"https://api.github.com/repos/thelounge/thelounge/languages","stargazers_url":"https://api.github.com/repos/thelounge/thelounge/stargazers","contributors_url":"https://api.github.com/repos/thelounge/thelounge/contributors","subscribers_url":"https://api.github.com/repos/thelounge/thelounge/subscribers","subscription_url":"https://api.github.com/repos/thelounge/thelounge/subscription","commits_url":"https://api.github.com/repos/thelounge/thelounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelounge/thelounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelounge/thelounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelounge/thelounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/thelounge/thelounge/contents/{+path}","compare_url":"https://api.github.com/repos/thelounge/thelounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelounge/thelounge/merges","archive_url":"https://api.github.com/repos/thelounge/thelounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelounge/thelounge/downloads","issues_url":"https://api.github.com/repos/thelounge/thelounge/issues{/number}","pulls_url":"https://api.github.com/repos/thelounge/thelounge/pulls{/number}","milestones_url":"https://api.github.com/repos/thelounge/thelounge/milestones{/number}","notifications_url":"https://api.github.com/repos/thelounge/thelounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelounge/thelounge/labels{/name}","releases_url":"https://api.github.com/repos/thelounge/thelounge/releases{/id}","deployments_url":"https://api.github.com/repos/thelounge/thelounge/deployments","created_at":"2016-02-09T03:16:03Z","updated_at":"2018-03-27T23:19:13Z","pushed_at":"2018-03-28T04:40:44Z","git_url":"git://github.com/thelounge/thelounge.git","ssh_url":"git@github.com:thelounge/thelounge.git","clone_url":"https://github.com/thelounge/thelounge.git","svn_url":"https://github.com/thelounge/thelounge","homepage":"https://thelounge.chat","size":8802,"stargazers_count":1816,"watchers_count":1816,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"archived":false,"open_issues_count":194,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":283,"open_issues":194,"watchers":1816,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2281"},"html":{"href":"https://github.com/thelounge/thelounge/pull/2281"},"issue":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/2281"},"comments":{"href":"https://api.github.com/repos/thelounge/thelounge/issues/2281/comments"},"review_comments":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2281/comments"},"review_comment":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thelounge/thelounge/pulls/2281/commits"},"statuses":{"href":"https://api.github.com/repos/thelounge/thelounge/statuses/4337b33869ed3c656f1dff6e70b3309dee4697eb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"astorije"}}