{"action":"created","comment":{"url":"https://api.github.com/repos/HabitRPG/habitica/pulls/comments/221522316","pull_request_review_id":160176422,"id":221522316,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTUyMjMxNg==","diff_hunk":"@@ -9,6 +9,10 @@ const SLACK_FLAGGING_URL = nconf.get('SLACK:FLAGGING_URL');\n const SLACK_FLAGGING_FOOTER_LINK = nconf.get('SLACK:FLAGGING_FOOTER_LINK');\n const SLACK_SUBSCRIPTIONS_URL = nconf.get('SLACK:SUBSCRIPTIONS_URL');\n const BASE_URL = nconf.get('BASE_URL');\n+const IS_PRODUCTION = nconf.get('IS_PROD');\n+\n+const SKIP_FLAG_METHODS = IS_PRODUCTION && !SLACK_FLAGGING_URL;\n+const SKIP_SUB_METHOD = IS_PRODUCTION && !SLACK_SUBSCRIPTIONS_URL;","path":"website/server/libs/slack.js","position":7,"original_position":7,"commit_id":"60a6f6f2f6eaa364495e33eeae7907c09a78a672","original_commit_id":"60a6f6f2f6eaa364495e33eeae7907c09a78a672","user":{"login":"Alys","id":1495809,"node_id":"MDQ6VXNlcjE0OTU4MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1495809?v=4","gravatar_id":"","url":"https://api.github.com/users/Alys","html_url":"https://github.com/Alys","followers_url":"https://api.github.com/users/Alys/followers","following_url":"https://api.github.com/users/Alys/following{/other_user}","gists_url":"https://api.github.com/users/Alys/gists{/gist_id}","starred_url":"https://api.github.com/users/Alys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alys/subscriptions","organizations_url":"https://api.github.com/users/Alys/orgs","repos_url":"https://api.github.com/users/Alys/repos","events_url":"https://api.github.com/users/Alys/events{/privacy}","received_events_url":"https://api.github.com/users/Alys/received_events","type":"User","site_admin":false},"body":"Just checking: This won't prevent the message being sent to slack when a post is flagged in staging, beta, gamma, and delta, will it? We do want flagging to work normally there, both for testing flagging and for cases where mods are using staging or the other sites for their normal use of Habitica (which is much of the time for staging). It might be worth adding a comment to clarify that.","created_at":"2018-10-01T08:07:49Z","updated_at":"2018-10-01T08:50:06Z","html_url":"https://github.com/HabitRPG/habitica/pull/10420#discussion_r221522316","pull_request_url":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/comments/221522316"},"html":{"href":"https://github.com/HabitRPG/habitica/pull/10420#discussion_r221522316"},"pull_request":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420"}}},"pull_request":{"url":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420","id":192208743,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjA4NzQz","html_url":"https://github.com/HabitRPG/habitica/pull/10420","diff_url":"https://github.com/HabitRPG/habitica/pull/10420.diff","patch_url":"https://github.com/HabitRPG/habitica/pull/10420.patch","issue_url":"https://api.github.com/repos/HabitRPG/habitica/issues/10420","number":10420,"state":"open","locked":false,"title":"Flag Private Messages","user":{"login":"negue","id":842273,"node_id":"MDQ6VXNlcjg0MjI3Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/842273?v=4","gravatar_id":"","url":"https://api.github.com/users/negue","html_url":"https://github.com/negue","followers_url":"https://api.github.com/users/negue/followers","following_url":"https://api.github.com/users/negue/following{/other_user}","gists_url":"https://api.github.com/users/negue/gists{/gist_id}","starred_url":"https://api.github.com/users/negue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/negue/subscriptions","organizations_url":"https://api.github.com/users/negue/orgs","repos_url":"https://api.github.com/users/negue/repos","events_url":"https://api.github.com/users/negue/events{/privacy}","received_events_url":"https://api.github.com/users/negue/received_events","type":"User","site_admin":false},"body":"- [x] Each PM should have a \"Report\" link and the same icon that you can see next to \"Report\" in guild messages. \r\n   - [x] That **includes** PMs sent by the player themself - they must be able to flag their own PMs (e.g., when needing to report both sides of a conversation to moderators).\r\n- [x] Clicking on the Report link will give the same confirmation screen that you see when you flag a guild message.  \r\n- [x] After any PM is flagged, it should contain a permanent notice something like \"You have reported this message to moderators.\" \r\n   - [x] That permanent notice should appear as soon as the flag has been **successfully** saved to the database and the report to the mods has been **successfully** sent. \r\n   - [x] It should not appear if those actions have failed.\r\n   - [x] If those actions fail, the user should see an error message (e.g., a red snackbar notification, that disappears after a few seconds) so that they know they need to try to flag the PM again.\r\n   - [x] It should not be necessary to reload or sync the website to see the permanent notice.\r\n- [x] A flagged PM should remain visible (if the player doesn't want to see it, they can delete it).\r\n- [x] When a PM is flagged, the same actions should occur to report it to mods as when a guild message is flagged: \r\n   - [x] an email should be sent to the same recipients as for guild messages\r\n   - [x] a notification should be sent to the moderator's slack channel. For reporting posts in guilds/parties/Tavern, that notification contains the phrase \"flagged a message\", but for PMs, the notification should contain the phrase \"flagged a PM\". The \"flagged a message\" text for guilds/parties/Tavern should be changed to \"flagged a group message\" to make it clearer to mods that it's not a PM.\r\n   - [x] the notifications in the slack channel need to make it clear who posted the message - see below for details in #9204 \r\n\r\nAlso TODO:\r\n- [x] tests\r\n- [x] update flag-o-rama for private messages\r\n\r\nfixes #9204","created_at":"2018-06-02T17:33:30Z","updated_at":"2018-10-01T08:50:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f6c004fe4376e0df71ab449e4e07610a68b7195","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":192741463,"node_id":"MDU6TGFiZWwxOTI3NDE0NjM=","url":"https://api.github.com/repos/HabitRPG/habitica/labels/status:%20pr:%20ready%20for%20review","name":"status: pr: ready for review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420/commits","review_comments_url":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420/comments","review_comment_url":"https://api.github.com/repos/HabitRPG/habitica/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HabitRPG/habitica/issues/10420/comments","statuses_url":"https://api.github.com/repos/HabitRPG/habitica/statuses/60a6f6f2f6eaa364495e33eeae7907c09a78a672","head":{"label":"HabitRPG:negue/flagpm","ref":"negue/flagpm","sha":"60a6f6f2f6eaa364495e33eeae7907c09a78a672","user":{"login":"HabitRPG","id":3834775,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzQ3NzU=","avatar_url":"https://avatars3.githubusercontent.com/u/3834775?v=4","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"repo":{"id":4578898,"node_id":"MDEwOlJlcG9zaXRvcnk0NTc4ODk4","name":"habitica","full_name":"HabitRPG/habitica","private":false,"owner":{"login":"HabitRPG","id":3834775,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzQ3NzU=","avatar_url":"https://avatars3.githubusercontent.com/u/3834775?v=4","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HabitRPG/habitica","description":"A habit tracker app which treats your goals like a Role Playing Game.","fork":false,"url":"https://api.github.com/repos/HabitRPG/habitica","forks_url":"https://api.github.com/repos/HabitRPG/habitica/forks","keys_url":"https://api.github.com/repos/HabitRPG/habitica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HabitRPG/habitica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HabitRPG/habitica/teams","hooks_url":"https://api.github.com/repos/HabitRPG/habitica/hooks","issue_events_url":"https://api.github.com/repos/HabitRPG/habitica/issues/events{/number}","events_url":"https://api.github.com/repos/HabitRPG/habitica/events","assignees_url":"https://api.github.com/repos/HabitRPG/habitica/assignees{/user}","branches_url":"https://api.github.com/repos/HabitRPG/habitica/branches{/branch}","tags_url":"https://api.github.com/repos/HabitRPG/habitica/tags","blobs_url":"https://api.github.com/repos/HabitRPG/habitica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HabitRPG/habitica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HabitRPG/habitica/git/refs{/sha}","trees_url":"https://api.github.com/repos/HabitRPG/habitica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HabitRPG/habitica/statuses/{sha}","languages_url":"https://api.github.com/repos/HabitRPG/habitica/languages","stargazers_url":"https://api.github.com/repos/HabitRPG/habitica/stargazers","contributors_url":"https://api.github.com/repos/HabitRPG/habitica/contributors","subscribers_url":"https://api.github.com/repos/HabitRPG/habitica/subscribers","subscription_url":"https://api.github.com/repos/HabitRPG/habitica/subscription","commits_url":"https://api.github.com/repos/HabitRPG/habitica/commits{/sha}","git_commits_url":"https://api.github.com/repos/HabitRPG/habitica/git/commits{/sha}","comments_url":"https://api.github.com/repos/HabitRPG/habitica/comments{/number}","issue_comment_url":"https://api.github.com/repos/HabitRPG/habitica/issues/comments{/number}","contents_url":"https://api.github.com/repos/HabitRPG/habitica/contents/{+path}","compare_url":"https://api.github.com/repos/HabitRPG/habitica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HabitRPG/habitica/merges","archive_url":"https://api.github.com/repos/HabitRPG/habitica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HabitRPG/habitica/downloads","issues_url":"https://api.github.com/repos/HabitRPG/habitica/issues{/number}","pulls_url":"https://api.github.com/repos/HabitRPG/habitica/pulls{/number}","milestones_url":"https://api.github.com/repos/HabitRPG/habitica/milestones{/number}","notifications_url":"https://api.github.com/repos/HabitRPG/habitica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HabitRPG/habitica/labels{/name}","releases_url":"https://api.github.com/repos/HabitRPG/habitica/releases{/id}","deployments_url":"https://api.github.com/repos/HabitRPG/habitica/deployments","created_at":"2012-06-06T22:49:48Z","updated_at":"2018-10-01T04:17:22Z","pushed_at":"2018-09-30T15:23:28Z","git_url":"git://github.com/HabitRPG/habitica.git","ssh_url":"git@github.com:HabitRPG/habitica.git","clone_url":"https://github.com/HabitRPG/habitica.git","svn_url":"https://github.com/HabitRPG/habitica","homepage":"https://habitica.com","size":962263,"stargazers_count":6212,"watchers_count":6212,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2692,"mirror_url":null,"archived":false,"open_issues_count":272,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2692,"open_issues":272,"watchers":6212,"default_branch":"develop"}},"base":{"label":"HabitRPG:develop","ref":"develop","sha":"71c0939a1595872096dcb0c12947b048d0b125dc","user":{"login":"HabitRPG","id":3834775,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzQ3NzU=","avatar_url":"https://avatars3.githubusercontent.com/u/3834775?v=4","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"repo":{"id":4578898,"node_id":"MDEwOlJlcG9zaXRvcnk0NTc4ODk4","name":"habitica","full_name":"HabitRPG/habitica","private":false,"owner":{"login":"HabitRPG","id":3834775,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MzQ3NzU=","avatar_url":"https://avatars3.githubusercontent.com/u/3834775?v=4","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HabitRPG/habitica","description":"A habit tracker app which treats your goals like a Role Playing Game.","fork":false,"url":"https://api.github.com/repos/HabitRPG/habitica","forks_url":"https://api.github.com/repos/HabitRPG/habitica/forks","keys_url":"https://api.github.com/repos/HabitRPG/habitica/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HabitRPG/habitica/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HabitRPG/habitica/teams","hooks_url":"https://api.github.com/repos/HabitRPG/habitica/hooks","issue_events_url":"https://api.github.com/repos/HabitRPG/habitica/issues/events{/number}","events_url":"https://api.github.com/repos/HabitRPG/habitica/events","assignees_url":"https://api.github.com/repos/HabitRPG/habitica/assignees{/user}","branches_url":"https://api.github.com/repos/HabitRPG/habitica/branches{/branch}","tags_url":"https://api.github.com/repos/HabitRPG/habitica/tags","blobs_url":"https://api.github.com/repos/HabitRPG/habitica/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HabitRPG/habitica/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HabitRPG/habitica/git/refs{/sha}","trees_url":"https://api.github.com/repos/HabitRPG/habitica/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HabitRPG/habitica/statuses/{sha}","languages_url":"https://api.github.com/repos/HabitRPG/habitica/languages","stargazers_url":"https://api.github.com/repos/HabitRPG/habitica/stargazers","contributors_url":"https://api.github.com/repos/HabitRPG/habitica/contributors","subscribers_url":"https://api.github.com/repos/HabitRPG/habitica/subscribers","subscription_url":"https://api.github.com/repos/HabitRPG/habitica/subscription","commits_url":"https://api.github.com/repos/HabitRPG/habitica/commits{/sha}","git_commits_url":"https://api.github.com/repos/HabitRPG/habitica/git/commits{/sha}","comments_url":"https://api.github.com/repos/HabitRPG/habitica/comments{/number}","issue_comment_url":"https://api.github.com/repos/HabitRPG/habitica/issues/comments{/number}","contents_url":"https://api.github.com/repos/HabitRPG/habitica/contents/{+path}","compare_url":"https://api.github.com/repos/HabitRPG/habitica/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HabitRPG/habitica/merges","archive_url":"https://api.github.com/repos/HabitRPG/habitica/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HabitRPG/habitica/downloads","issues_url":"https://api.github.com/repos/HabitRPG/habitica/issues{/number}","pulls_url":"https://api.github.com/repos/HabitRPG/habitica/pulls{/number}","milestones_url":"https://api.github.com/repos/HabitRPG/habitica/milestones{/number}","notifications_url":"https://api.github.com/repos/HabitRPG/habitica/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HabitRPG/habitica/labels{/name}","releases_url":"https://api.github.com/repos/HabitRPG/habitica/releases{/id}","deployments_url":"https://api.github.com/repos/HabitRPG/habitica/deployments","created_at":"2012-06-06T22:49:48Z","updated_at":"2018-10-01T04:17:22Z","pushed_at":"2018-09-30T15:23:28Z","git_url":"git://github.com/HabitRPG/habitica.git","ssh_url":"git@github.com:HabitRPG/habitica.git","clone_url":"https://github.com/HabitRPG/habitica.git","svn_url":"https://github.com/HabitRPG/habitica","homepage":"https://habitica.com","size":962263,"stargazers_count":6212,"watchers_count":6212,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2692,"mirror_url":null,"archived":false,"open_issues_count":272,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2692,"open_issues":272,"watchers":6212,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420"},"html":{"href":"https://github.com/HabitRPG/habitica/pull/10420"},"issue":{"href":"https://api.github.com/repos/HabitRPG/habitica/issues/10420"},"comments":{"href":"https://api.github.com/repos/HabitRPG/habitica/issues/10420/comments"},"review_comments":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420/comments"},"review_comment":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HabitRPG/habitica/pulls/10420/commits"},"statuses":{"href":"https://api.github.com/repos/HabitRPG/habitica/statuses/60a6f6f2f6eaa364495e33eeae7907c09a78a672"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Alys"}}