{"action":"created","comment":{"url":"https://api.github.com/repos/thredded/thredded/pulls/comments/65583571","id":65583571,"diff_hunk":"@@ -30,16 +30,16 @@ module ContentModerationState\n       end)\n     end\n \n-    def visible_to_all?\n+    def moderation_state_visible_to_all?\n       if Thredded.content_visible_while_pending_moderation\n         !blocked?\n       else\n         approved?\n       end\n     end\n \n-    def visible_to_user?(user)\n-      visible_to_all? || (!user.thredded_anonymous? && user_id == user.id)\n+    def moderation_state_visible_to_user?(user)\n+      moderation_state_visible_to_all? || (!user.thredded_anonymous? && user_id == user.id)","path":"app/models/concerns/thredded/content_moderation_state.rb","position":null,"original_position":25,"commit_id":"14346b811608602bdc7970191a512c16d9f0bdf5","original_commit_id":"e36db619c0de7069468a54791d5e8b71f459f53c","user":{"login":"glebm","id":216339,"avatar_url":"https://avatars.githubusercontent.com/u/216339?v=3","gravatar_id":"","url":"https://api.github.com/users/glebm","html_url":"https://github.com/glebm","followers_url":"https://api.github.com/users/glebm/followers","following_url":"https://api.github.com/users/glebm/following{/other_user}","gists_url":"https://api.github.com/users/glebm/gists{/gist_id}","starred_url":"https://api.github.com/users/glebm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebm/subscriptions","organizations_url":"https://api.github.com/users/glebm/orgs","repos_url":"https://api.github.com/users/glebm/repos","events_url":"https://api.github.com/users/glebm/events{/privacy}","received_events_url":"https://api.github.com/users/glebm/received_events","type":"User","site_admin":false},"body":"If a user that posted a post is deleted, the post's `user_id` will be `nil`.","created_at":"2016-06-02T17:32:28Z","updated_at":"2016-06-02T17:32:29Z","html_url":"https://github.com/thredded/thredded/pull/304#discussion_r65583571","pull_request_url":"https://api.github.com/repos/thredded/thredded/pulls/304","_links":{"self":{"href":"https://api.github.com/repos/thredded/thredded/pulls/comments/65583571"},"html":{"href":"https://github.com/thredded/thredded/pull/304#discussion_r65583571"},"pull_request":{"href":"https://api.github.com/repos/thredded/thredded/pulls/304"}}},"pull_request":{"url":"https://api.github.com/repos/thredded/thredded/pulls/304","id":70982078,"html_url":"https://github.com/thredded/thredded/pull/304","diff_url":"https://github.com/thredded/thredded/pull/304.diff","patch_url":"https://github.com/thredded/thredded/pull/304.patch","issue_url":"https://api.github.com/repos/thredded/thredded/issues/304","number":304,"state":"open","locked":false,"title":"A basic moderation system","user":{"login":"glebm","id":216339,"avatar_url":"https://avatars.githubusercontent.com/u/216339?v=3","gravatar_id":"","url":"https://api.github.com/users/glebm","html_url":"https://github.com/glebm","followers_url":"https://api.github.com/users/glebm/followers","following_url":"https://api.github.com/users/glebm/following{/other_user}","gists_url":"https://api.github.com/users/glebm/gists{/gist_id}","starred_url":"https://api.github.com/users/glebm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebm/subscriptions","organizations_url":"https://api.github.com/users/glebm/orgs","repos_url":"https://api.github.com/users/glebm/repos","events_url":"https://api.github.com/users/glebm/events{/privacy}","received_events_url":"https://api.github.com/users/glebm/received_events","type":"User","site_admin":false},"body":"Adds a basic moderation system to Thredded! :boom: \r\n\r\nReadme description:\r\n\r\n> Thredded comes with two options for the moderation system:\r\n> \r\n> 1. Pre-emptive moderation, where posts from first-time users are not published until they have been approved.\r\n> 2. Reactive moderation, where posts from first-time users are published immediately but enter the moderation queue.\r\n> \r\n> This is controlled by the `Thredded.content_visible_while_pending_moderation` setting.\r\n> \r\n> Users, topics, and posts can be in one of three moderation states: `pending_moderation`, `approved`, and `blocked`. By default, new users are `pending_moderation`, and new posts and topics\r\ninherit their default moderation_state from the user's.\r\n>\r\n> This means that when you approve a new user's post, all of their later posts will be approved automatically.\r\n> \r\n> Additionally, users always see their own posts regardless of the moderation state. For blocked users, this means they might not realize they have been blocked right away.\r\n> \r\n> Blocked users cannot send private messages.\r\n\r\nTODO: Counters should count only approved content. This is rather difficult to do, so let's postpone until we add counter_culture.\r\n\r\nRefs #45\r\n\r\n---\r\n\r\nModeration queue:\r\n![moderation-1](https://cloud.githubusercontent.com/assets/216339/15455274/4416d0f8-2047-11e6-9f75-1d4af29a79f4.png)\r\n\r\n---\r\n\r\nModeration queue after approving a post (on mobile):\r\n![moderation-mobile](https://cloud.githubusercontent.com/assets/216339/15455276/441d0266-2047-11e6-88ee-a8a9d5e7eb28.png)\r\n\r\n---\r\n\r\nModeration history:\r\n![moderation-history](https://cloud.githubusercontent.com/assets/216339/15455275/441b25e0-2047-11e6-8b3c-bbb7070796fa.png)\r\n\r\n---\r\n\r\nPre-emptive moderation user notice:\r\n\r\n![moderation-post](https://cloud.githubusercontent.com/assets/216339/15455277/44220414-2047-11e6-8a55-c83634e2b6f2.png)\r\n\r\n/cc @timdiggins @jayroh \r\n\r\n","created_at":"2016-05-22T16:54:59Z","updated_at":"2016-06-02T17:32:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ce9625c251a2b4f90e981c39d0746e1f548e36d","assignee":{"login":"jayroh","id":28194,"avatar_url":"https://avatars.githubusercontent.com/u/28194?v=3","gravatar_id":"","url":"https://api.github.com/users/jayroh","html_url":"https://github.com/jayroh","followers_url":"https://api.github.com/users/jayroh/followers","following_url":"https://api.github.com/users/jayroh/following{/other_user}","gists_url":"https://api.github.com/users/jayroh/gists{/gist_id}","starred_url":"https://api.github.com/users/jayroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayroh/subscriptions","organizations_url":"https://api.github.com/users/jayroh/orgs","repos_url":"https://api.github.com/users/jayroh/repos","events_url":"https://api.github.com/users/jayroh/events{/privacy}","received_events_url":"https://api.github.com/users/jayroh/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/thredded/thredded/milestones/9","html_url":"https://github.com/thredded/thredded/milestones/v0.5.0","labels_url":"https://api.github.com/repos/thredded/thredded/milestones/9/labels","id":1769594,"number":9,"title":"v0.5.0","description":"","creator":{"login":"glebm","id":216339,"avatar_url":"https://avatars.githubusercontent.com/u/216339?v=3","gravatar_id":"","url":"https://api.github.com/users/glebm","html_url":"https://github.com/glebm","followers_url":"https://api.github.com/users/glebm/followers","following_url":"https://api.github.com/users/glebm/following{/other_user}","gists_url":"https://api.github.com/users/glebm/gists{/gist_id}","starred_url":"https://api.github.com/users/glebm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebm/subscriptions","organizations_url":"https://api.github.com/users/glebm/orgs","repos_url":"https://api.github.com/users/glebm/repos","events_url":"https://api.github.com/users/glebm/events{/privacy}","received_events_url":"https://api.github.com/users/glebm/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2016-05-16T18:38:19Z","updated_at":"2016-05-31T18:37:34Z","due_on":"2016-05-30T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/thredded/thredded/pulls/304/commits","review_comments_url":"https://api.github.com/repos/thredded/thredded/pulls/304/comments","review_comment_url":"https://api.github.com/repos/thredded/thredded/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thredded/thredded/issues/304/comments","statuses_url":"https://api.github.com/repos/thredded/thredded/statuses/14346b811608602bdc7970191a512c16d9f0bdf5","head":{"label":"thredded:moderation","ref":"moderation","sha":"14346b811608602bdc7970191a512c16d9f0bdf5","user":{"login":"thredded","id":14218084,"avatar_url":"https://avatars.githubusercontent.com/u/14218084?v=3","gravatar_id":"","url":"https://api.github.com/users/thredded","html_url":"https://github.com/thredded","followers_url":"https://api.github.com/users/thredded/followers","following_url":"https://api.github.com/users/thredded/following{/other_user}","gists_url":"https://api.github.com/users/thredded/gists{/gist_id}","starred_url":"https://api.github.com/users/thredded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thredded/subscriptions","organizations_url":"https://api.github.com/users/thredded/orgs","repos_url":"https://api.github.com/users/thredded/repos","events_url":"https://api.github.com/users/thredded/events{/privacy}","received_events_url":"https://api.github.com/users/thredded/received_events","type":"Organization","site_admin":false},"repo":{"id":9949492,"name":"thredded","full_name":"thredded/thredded","owner":{"login":"thredded","id":14218084,"avatar_url":"https://avatars.githubusercontent.com/u/14218084?v=3","gravatar_id":"","url":"https://api.github.com/users/thredded","html_url":"https://github.com/thredded","followers_url":"https://api.github.com/users/thredded/followers","following_url":"https://api.github.com/users/thredded/following{/other_user}","gists_url":"https://api.github.com/users/thredded/gists{/gist_id}","starred_url":"https://api.github.com/users/thredded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thredded/subscriptions","organizations_url":"https://api.github.com/users/thredded/orgs","repos_url":"https://api.github.com/users/thredded/repos","events_url":"https://api.github.com/users/thredded/events{/privacy}","received_events_url":"https://api.github.com/users/thredded/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thredded/thredded","description":"The best Rails forums engine ever.","fork":false,"url":"https://api.github.com/repos/thredded/thredded","forks_url":"https://api.github.com/repos/thredded/thredded/forks","keys_url":"https://api.github.com/repos/thredded/thredded/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thredded/thredded/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thredded/thredded/teams","hooks_url":"https://api.github.com/repos/thredded/thredded/hooks","issue_events_url":"https://api.github.com/repos/thredded/thredded/issues/events{/number}","events_url":"https://api.github.com/repos/thredded/thredded/events","assignees_url":"https://api.github.com/repos/thredded/thredded/assignees{/user}","branches_url":"https://api.github.com/repos/thredded/thredded/branches{/branch}","tags_url":"https://api.github.com/repos/thredded/thredded/tags","blobs_url":"https://api.github.com/repos/thredded/thredded/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thredded/thredded/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thredded/thredded/git/refs{/sha}","trees_url":"https://api.github.com/repos/thredded/thredded/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thredded/thredded/statuses/{sha}","languages_url":"https://api.github.com/repos/thredded/thredded/languages","stargazers_url":"https://api.github.com/repos/thredded/thredded/stargazers","contributors_url":"https://api.github.com/repos/thredded/thredded/contributors","subscribers_url":"https://api.github.com/repos/thredded/thredded/subscribers","subscription_url":"https://api.github.com/repos/thredded/thredded/subscription","commits_url":"https://api.github.com/repos/thredded/thredded/commits{/sha}","git_commits_url":"https://api.github.com/repos/thredded/thredded/git/commits{/sha}","comments_url":"https://api.github.com/repos/thredded/thredded/comments{/number}","issue_comment_url":"https://api.github.com/repos/thredded/thredded/issues/comments{/number}","contents_url":"https://api.github.com/repos/thredded/thredded/contents/{+path}","compare_url":"https://api.github.com/repos/thredded/thredded/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thredded/thredded/merges","archive_url":"https://api.github.com/repos/thredded/thredded/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thredded/thredded/downloads","issues_url":"https://api.github.com/repos/thredded/thredded/issues{/number}","pulls_url":"https://api.github.com/repos/thredded/thredded/pulls{/number}","milestones_url":"https://api.github.com/repos/thredded/thredded/milestones{/number}","notifications_url":"https://api.github.com/repos/thredded/thredded/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thredded/thredded/labels{/name}","releases_url":"https://api.github.com/repos/thredded/thredded/releases{/id}","deployments_url":"https://api.github.com/repos/thredded/thredded/deployments","created_at":"2013-05-09T01:17:41Z","updated_at":"2016-06-02T03:57:48Z","pushed_at":"2016-06-02T16:39:23Z","git_url":"git://github.com/thredded/thredded.git","ssh_url":"git@github.com:thredded/thredded.git","clone_url":"https://github.com/thredded/thredded.git","svn_url":"https://github.com/thredded/thredded","homepage":"https://thredded.org","size":2036,"stargazers_count":375,"watchers_count":375,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":38,"forks":41,"open_issues":38,"watchers":375,"default_branch":"master"}},"base":{"label":"thredded:master","ref":"master","sha":"995bafe25784e5cb2eca3d558d0cc1e3aceea5c0","user":{"login":"thredded","id":14218084,"avatar_url":"https://avatars.githubusercontent.com/u/14218084?v=3","gravatar_id":"","url":"https://api.github.com/users/thredded","html_url":"https://github.com/thredded","followers_url":"https://api.github.com/users/thredded/followers","following_url":"https://api.github.com/users/thredded/following{/other_user}","gists_url":"https://api.github.com/users/thredded/gists{/gist_id}","starred_url":"https://api.github.com/users/thredded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thredded/subscriptions","organizations_url":"https://api.github.com/users/thredded/orgs","repos_url":"https://api.github.com/users/thredded/repos","events_url":"https://api.github.com/users/thredded/events{/privacy}","received_events_url":"https://api.github.com/users/thredded/received_events","type":"Organization","site_admin":false},"repo":{"id":9949492,"name":"thredded","full_name":"thredded/thredded","owner":{"login":"thredded","id":14218084,"avatar_url":"https://avatars.githubusercontent.com/u/14218084?v=3","gravatar_id":"","url":"https://api.github.com/users/thredded","html_url":"https://github.com/thredded","followers_url":"https://api.github.com/users/thredded/followers","following_url":"https://api.github.com/users/thredded/following{/other_user}","gists_url":"https://api.github.com/users/thredded/gists{/gist_id}","starred_url":"https://api.github.com/users/thredded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thredded/subscriptions","organizations_url":"https://api.github.com/users/thredded/orgs","repos_url":"https://api.github.com/users/thredded/repos","events_url":"https://api.github.com/users/thredded/events{/privacy}","received_events_url":"https://api.github.com/users/thredded/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thredded/thredded","description":"The best Rails forums engine ever.","fork":false,"url":"https://api.github.com/repos/thredded/thredded","forks_url":"https://api.github.com/repos/thredded/thredded/forks","keys_url":"https://api.github.com/repos/thredded/thredded/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thredded/thredded/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thredded/thredded/teams","hooks_url":"https://api.github.com/repos/thredded/thredded/hooks","issue_events_url":"https://api.github.com/repos/thredded/thredded/issues/events{/number}","events_url":"https://api.github.com/repos/thredded/thredded/events","assignees_url":"https://api.github.com/repos/thredded/thredded/assignees{/user}","branches_url":"https://api.github.com/repos/thredded/thredded/branches{/branch}","tags_url":"https://api.github.com/repos/thredded/thredded/tags","blobs_url":"https://api.github.com/repos/thredded/thredded/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thredded/thredded/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thredded/thredded/git/refs{/sha}","trees_url":"https://api.github.com/repos/thredded/thredded/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thredded/thredded/statuses/{sha}","languages_url":"https://api.github.com/repos/thredded/thredded/languages","stargazers_url":"https://api.github.com/repos/thredded/thredded/stargazers","contributors_url":"https://api.github.com/repos/thredded/thredded/contributors","subscribers_url":"https://api.github.com/repos/thredded/thredded/subscribers","subscription_url":"https://api.github.com/repos/thredded/thredded/subscription","commits_url":"https://api.github.com/repos/thredded/thredded/commits{/sha}","git_commits_url":"https://api.github.com/repos/thredded/thredded/git/commits{/sha}","comments_url":"https://api.github.com/repos/thredded/thredded/comments{/number}","issue_comment_url":"https://api.github.com/repos/thredded/thredded/issues/comments{/number}","contents_url":"https://api.github.com/repos/thredded/thredded/contents/{+path}","compare_url":"https://api.github.com/repos/thredded/thredded/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thredded/thredded/merges","archive_url":"https://api.github.com/repos/thredded/thredded/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thredded/thredded/downloads","issues_url":"https://api.github.com/repos/thredded/thredded/issues{/number}","pulls_url":"https://api.github.com/repos/thredded/thredded/pulls{/number}","milestones_url":"https://api.github.com/repos/thredded/thredded/milestones{/number}","notifications_url":"https://api.github.com/repos/thredded/thredded/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thredded/thredded/labels{/name}","releases_url":"https://api.github.com/repos/thredded/thredded/releases{/id}","deployments_url":"https://api.github.com/repos/thredded/thredded/deployments","created_at":"2013-05-09T01:17:41Z","updated_at":"2016-06-02T03:57:48Z","pushed_at":"2016-06-02T16:39:23Z","git_url":"git://github.com/thredded/thredded.git","ssh_url":"git@github.com:thredded/thredded.git","clone_url":"https://github.com/thredded/thredded.git","svn_url":"https://github.com/thredded/thredded","homepage":"https://thredded.org","size":2036,"stargazers_count":375,"watchers_count":375,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":38,"forks":41,"open_issues":38,"watchers":375,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thredded/thredded/pulls/304"},"html":{"href":"https://github.com/thredded/thredded/pull/304"},"issue":{"href":"https://api.github.com/repos/thredded/thredded/issues/304"},"comments":{"href":"https://api.github.com/repos/thredded/thredded/issues/304/comments"},"review_comments":{"href":"https://api.github.com/repos/thredded/thredded/pulls/304/comments"},"review_comment":{"href":"https://api.github.com/repos/thredded/thredded/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thredded/thredded/pulls/304/commits"},"statuses":{"href":"https://api.github.com/repos/thredded/thredded/statuses/14346b811608602bdc7970191a512c16d9f0bdf5"}}}}
{"actor":{"display_login":"glebm"}}