{"action":"created","comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/73255365","id":73255365,"diff_hunk":"@@ -7,3 +7,28 @@ RocketChat.models.Rooms.setDescriptionById = (_id, description) ->\n \t\t\tdescription: description\n \n \treturn @update query, update\n+\n+RocketChat.models.Rooms.setReadOnlyById = (_id, readOnly) ->\n+\tquery =\n+\t\t_id: _id\n+\n+\tupdate =\n+\t\t$set:\n+\t\t\tro: readOnly\n+\n+\tif readOnly\n+\t\tusers = @findOne(query, { fields: { usernames: 1 }})?.usernames","path":"packages/rocketchat-channel-settings/server/models/Rooms.coffee","position":14,"original_position":14,"commit_id":"9638544f7593bf9ea08d063fef9f2fefd1407a34","original_commit_id":"9638544f7593bf9ea08d063fef9f2fefd1407a34","user":{"login":"rodrigok","id":234261,"avatar_url":"https://avatars.githubusercontent.com/u/234261?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigok","html_url":"https://github.com/rodrigok","followers_url":"https://api.github.com/users/rodrigok/followers","following_url":"https://api.github.com/users/rodrigok/following{/other_user}","gists_url":"https://api.github.com/users/rodrigok/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigok/subscriptions","organizations_url":"https://api.github.com/users/rodrigok/orgs","repos_url":"https://api.github.com/users/rodrigok/repos","events_url":"https://api.github.com/users/rodrigok/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigok/received_events","type":"User","site_admin":false},"body":"Why are you doing this query?","created_at":"2016-08-02T23:12:44Z","updated_at":"2016-08-02T23:12:44Z","html_url":"https://github.com/RocketChat/Rocket.Chat/pull/3861#discussion_r73255365","pull_request_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861","_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/73255365"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/3861#discussion_r73255365"},"pull_request":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861"}}},"pull_request":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861","id":78757724,"html_url":"https://github.com/RocketChat/Rocket.Chat/pull/3861","diff_url":"https://github.com/RocketChat/Rocket.Chat/pull/3861.diff","patch_url":"https://github.com/RocketChat/Rocket.Chat/pull/3861.patch","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3861","number":3861,"state":"open","locked":false,"title":"Add read only channels","user":{"login":"alexbrazier","id":5689874,"avatar_url":"https://avatars.githubusercontent.com/u/5689874?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbrazier","html_url":"https://github.com/alexbrazier","followers_url":"https://api.github.com/users/alexbrazier/followers","following_url":"https://api.github.com/users/alexbrazier/following{/other_user}","gists_url":"https://api.github.com/users/alexbrazier/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbrazier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbrazier/subscriptions","organizations_url":"https://api.github.com/users/alexbrazier/orgs","repos_url":"https://api.github.com/users/alexbrazier/repos","events_url":"https://api.github.com/users/alexbrazier/events{/privacy}","received_events_url":"https://api.github.com/users/alexbrazier/received_events","type":"User","site_admin":false},"body":"<!-- INSTRUCTION: Keep the line below to notify all core developers about this new PR -->\r\n@RocketChat/core \r\n\r\n<!-- INSTRUCTION: Inform the issue number that this PR closes, or remove the line below -->\r\nCloses #825 \r\n\r\n<!-- INSTRUCTION: Tell us more about your PR with screen shots if you can -->\r\n\r\nAdd read only channels and private groups.\r\n\r\n- Mute all users when they join a read only channel\r\n- Allow room owner or admin to manually unmute user who has permission to post\r\n- Allow user owner or admin to change existing room between read only (will mute/unmute ALL users in room)\r\n- Added mute icon next to user to quickly check if user is muted (visible in all channels - not just read only) - see screenshot\r\n\r\nCurrently it doesn't post in the channel when someone joins, or if someone switches channel between read only states, but it does post if an admin adds a user, or manually mutes/unmutes user - any thoughts on the expected behaviour of when to post system message?\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5689874/17118479/a8761ace-52b8-11e6-90ae-085945964232.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5689874/17118520/cc4111ac-52b8-11e6-9c20-4cf0f5cf95c4.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/5689874/17264718/c9efae4c-55e0-11e6-82d7-d1ec43f4eb13.png)\r\n\r\n\r\nBot tells user they have been muted if they try to post in a read only channel (unless they have been given permission)\r\n![image](https://cloud.githubusercontent.com/assets/5689874/17118619/46264f78-52b9-11e6-99fa-dedf2ad10d9d.png)\r\n\r\n- [x] Make read-only use a permission for allowing to post\r\n- [x] Add room controls to suppress notification types","created_at":"2016-07-25T21:44:23Z","updated_at":"2016-08-02T23:12:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87cebeac5b2a9c680b690068230e323acbe2fe03","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861/commits","review_comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861/comments","review_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3861/comments","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/9638544f7593bf9ea08d063fef9f2fefd1407a34","head":{"label":"alexbrazier:feature/read-only-rooms","ref":"feature/read-only-rooms","sha":"9638544f7593bf9ea08d063fef9f2fefd1407a34","user":{"login":"alexbrazier","id":5689874,"avatar_url":"https://avatars.githubusercontent.com/u/5689874?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbrazier","html_url":"https://github.com/alexbrazier","followers_url":"https://api.github.com/users/alexbrazier/followers","following_url":"https://api.github.com/users/alexbrazier/following{/other_user}","gists_url":"https://api.github.com/users/alexbrazier/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbrazier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbrazier/subscriptions","organizations_url":"https://api.github.com/users/alexbrazier/orgs","repos_url":"https://api.github.com/users/alexbrazier/repos","events_url":"https://api.github.com/users/alexbrazier/events{/privacy}","received_events_url":"https://api.github.com/users/alexbrazier/received_events","type":"User","site_admin":false},"repo":{"id":60974943,"name":"Rocket.Chat","full_name":"alexbrazier/Rocket.Chat","owner":{"login":"alexbrazier","id":5689874,"avatar_url":"https://avatars.githubusercontent.com/u/5689874?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbrazier","html_url":"https://github.com/alexbrazier","followers_url":"https://api.github.com/users/alexbrazier/followers","following_url":"https://api.github.com/users/alexbrazier/following{/other_user}","gists_url":"https://api.github.com/users/alexbrazier/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbrazier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbrazier/subscriptions","organizations_url":"https://api.github.com/users/alexbrazier/orgs","repos_url":"https://api.github.com/users/alexbrazier/repos","events_url":"https://api.github.com/users/alexbrazier/events{/privacy}","received_events_url":"https://api.github.com/users/alexbrazier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexbrazier/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":true,"url":"https://api.github.com/repos/alexbrazier/Rocket.Chat","forks_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/alexbrazier/Rocket.Chat/deployments","created_at":"2016-06-12T15:40:03Z","updated_at":"2016-06-12T15:40:10Z","pushed_at":"2016-08-01T20:33:15Z","git_url":"git://github.com/alexbrazier/Rocket.Chat.git","ssh_url":"git@github.com:alexbrazier/Rocket.Chat.git","clone_url":"https://github.com/alexbrazier/Rocket.Chat.git","svn_url":"https://github.com/alexbrazier/Rocket.Chat","homepage":"https://rocket.chat/","size":43167,"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":"develop"}},"base":{"label":"RocketChat:develop","ref":"develop","sha":"15e307099b7468ab1b38ade1bab3397852c58925","user":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"repo":{"id":35866694,"name":"Rocket.Chat","full_name":"RocketChat/Rocket.Chat","owner":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketChat/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":false,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat","forks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/deployments","created_at":"2015-05-19T07:36:09Z","updated_at":"2016-08-02T19:56:38Z","pushed_at":"2016-08-02T22:53:42Z","git_url":"git://github.com/RocketChat/Rocket.Chat.git","ssh_url":"git@github.com:RocketChat/Rocket.Chat.git","clone_url":"https://github.com/RocketChat/Rocket.Chat.git","svn_url":"https://github.com/RocketChat/Rocket.Chat","homepage":"https://rocket.chat/","size":58401,"stargazers_count":8276,"watchers_count":8276,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1739,"mirror_url":null,"open_issues_count":1066,"forks":1739,"open_issues":1066,"watchers":8276,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/3861"},"issue":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3861"},"comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/3861/comments"},"review_comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861/comments"},"review_comment":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/3861/commits"},"statuses":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/9638544f7593bf9ea08d063fef9f2fefd1407a34"}}}}
{"actor":{"display_login":"rodrigok"}}