{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/80281458","id":80281458,"diff_hunk":"@@ -56,11 +56,11 @@ def text= text\n   end\n \n   def people_allowed_to_be_mentioned\n-    @people_allowed_to_be_mentioned ||= if parent.public?\n-                                          \"all\"\n-                                        else\n-                                          [*parent.participants, parent.author].map(&:id).uniq\n-                                        end\n+    if parent.public?\n+      \"all\"\n+    else\n+      [*parent.participants, parent.author].map(&:id).uniq","path":"app/models/comment.rb","position":null,"original_position":12,"commit_id":"e58269a2266b5d15c6184beafa15c88a60462610","original_commit_id":"e58269a2266b5d15c6184beafa15c88a60462610","user":{"login":"SuperTux88","id":458548,"avatar_url":"https://avatars.githubusercontent.com/u/458548?v=3","gravatar_id":"","url":"https://api.github.com/users/SuperTux88","html_url":"https://github.com/SuperTux88","followers_url":"https://api.github.com/users/SuperTux88/followers","following_url":"https://api.github.com/users/SuperTux88/following{/other_user}","gists_url":"https://api.github.com/users/SuperTux88/gists{/gist_id}","starred_url":"https://api.github.com/users/SuperTux88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuperTux88/subscriptions","organizations_url":"https://api.github.com/users/SuperTux88/orgs","repos_url":"https://api.github.com/users/SuperTux88/repos","events_url":"https://api.github.com/users/SuperTux88/events{/privacy}","received_events_url":"https://api.github.com/users/SuperTux88/received_events","type":"User","site_admin":false},"body":"sounds good. 👍 ","created_at":"2016-09-23T16:46:03Z","updated_at":"2016-09-23T16:46:03Z","html_url":"https://github.com/diaspora/diaspora/pull/6818#discussion_r80281458","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6818","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/80281458"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6818#discussion_r80281458"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6818"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/6818","id":68418226,"html_url":"https://github.com/diaspora/diaspora/pull/6818","diff_url":"https://github.com/diaspora/diaspora/pull/6818.diff","patch_url":"https://github.com/diaspora/diaspora/pull/6818.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/6818","number":6818,"state":"open","locked":false,"title":"Mentions in comments backend changes","user":{"login":"cmrd-senya","id":10187586,"avatar_url":"https://avatars.githubusercontent.com/u/10187586?v=3","gravatar_id":"","url":"https://api.github.com/users/cmrd-senya","html_url":"https://github.com/cmrd-senya","followers_url":"https://api.github.com/users/cmrd-senya/followers","following_url":"https://api.github.com/users/cmrd-senya/following{/other_user}","gists_url":"https://api.github.com/users/cmrd-senya/gists{/gist_id}","starred_url":"https://api.github.com/users/cmrd-senya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmrd-senya/subscriptions","organizations_url":"https://api.github.com/users/cmrd-senya/orgs","repos_url":"https://api.github.com/users/cmrd-senya/repos","events_url":"https://api.github.com/users/cmrd-senya/events{/privacy}","received_events_url":"https://api.github.com/users/cmrd-senya/received_events","type":"User","site_admin":false},"body":"This is an early preliminary PR with backend-changes to support mentions in comments (#1851).\r\n\r\nIt introduces changes to the DB schema making Mention model polymorphic and allowing a mention to belong to a comment. It also creates module Diaspora::MentionsContainer which incapsulates the logic of an object that supports keeping mentions. Now it includes logic I picked from the StatusMessage model.\r\n\r\nATM the mentions in comments are supported to the extent of placing user profile links instead of mention code in the mobile version (it is so because the mobile version doesn't require javascript code changes).\r\n\r\nChanges summary:\r\n- Make Mention model polymorphic;\r\n- Introduce Diaspora::MentionsContainer which incapsulates the logic of an object that supports keeping mentions;\r\n- We don't filter mentions anymore, instead we send notification/show in streams only that mentions, which are visible to the recipient;\r\n- Create Notifications::Mentioned module which incapsulates common logic of mentioned notification;\r\n- Add Notifications::MentionedInComment and move old Notifications::Mentioned to Notifications::MentionedInPost;\r\n- Update the UI code to render new type of notification;\r\n- Hack comments notifications to avoid having double notification when mentioned in a comment;\r\n\r\nDrive-by refactorings:\r\n- Move Notification.types out of the model to the controller;\r\n- Move `StatusMessage#mentioned_people_names` out of the model. Create a `PersonPresenter.people_names` method instead;\r\n- DRY UserController to use UserPreference::VALID_EMAIL_TYPES in the `user_params` method;\r\n\r\nTODO:\r\n- [x] Implement notifications for mentioning in comments\r\n- [x] Implement restrictions of mentioning some kind of people (see [comment](https://github.com/diaspora/diaspora/issues/1851#issuecomment-36557842))\r\n- [x] Ensure comment is federated to new discussion participants\r\n- [x] Ensure mentions in comment are filtered on federation receive\r\n- [x] ~~Ensure the filtered out mentions are replaced with links properly~~\r\n- [x] Don't send redundant second notification when mentioned in comment.\r\n- [x] Ensure email notifications work properly\r\n- [ ] ~~Implement frontend javascript changes for comments publisher~~","created_at":"2016-04-29T19:00:47Z","updated_at":"2016-09-23T16:46:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbb81576a7378244c7439a9fa9965ca52e66c91f","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/diaspora/diaspora/milestones/23","html_url":"https://github.com/diaspora/diaspora/milestones/0.7.0.0","labels_url":"https://api.github.com/repos/diaspora/diaspora/milestones/23/labels","id":1580816,"number":23,"title":"0.7.0.0","description":"","creator":{"login":"denschub","id":344777,"avatar_url":"https://avatars.githubusercontent.com/u/344777?v=3","gravatar_id":"","url":"https://api.github.com/users/denschub","html_url":"https://github.com/denschub","followers_url":"https://api.github.com/users/denschub/followers","following_url":"https://api.github.com/users/denschub/following{/other_user}","gists_url":"https://api.github.com/users/denschub/gists{/gist_id}","starred_url":"https://api.github.com/users/denschub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denschub/subscriptions","organizations_url":"https://api.github.com/users/denschub/orgs","repos_url":"https://api.github.com/users/denschub/repos","events_url":"https://api.github.com/users/denschub/events{/privacy}","received_events_url":"https://api.github.com/users/denschub/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-02-13T03:23:01Z","updated_at":"2016-08-08T20:59:43Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6818/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6818/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/6818/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/e58269a2266b5d15c6184beafa15c88a60462610","head":{"label":"cmrd-senya:1851-mentions-in-comments.new","ref":"1851-mentions-in-comments.new","sha":"e58269a2266b5d15c6184beafa15c88a60462610","user":{"login":"cmrd-senya","id":10187586,"avatar_url":"https://avatars.githubusercontent.com/u/10187586?v=3","gravatar_id":"","url":"https://api.github.com/users/cmrd-senya","html_url":"https://github.com/cmrd-senya","followers_url":"https://api.github.com/users/cmrd-senya/followers","following_url":"https://api.github.com/users/cmrd-senya/following{/other_user}","gists_url":"https://api.github.com/users/cmrd-senya/gists{/gist_id}","starred_url":"https://api.github.com/users/cmrd-senya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmrd-senya/subscriptions","organizations_url":"https://api.github.com/users/cmrd-senya/orgs","repos_url":"https://api.github.com/users/cmrd-senya/repos","events_url":"https://api.github.com/users/cmrd-senya/events{/privacy}","received_events_url":"https://api.github.com/users/cmrd-senya/received_events","type":"User","site_admin":false},"repo":{"id":38250193,"name":"diaspora","full_name":"cmrd-senya/diaspora","owner":{"login":"cmrd-senya","id":10187586,"avatar_url":"https://avatars.githubusercontent.com/u/10187586?v=3","gravatar_id":"","url":"https://api.github.com/users/cmrd-senya","html_url":"https://github.com/cmrd-senya","followers_url":"https://api.github.com/users/cmrd-senya/followers","following_url":"https://api.github.com/users/cmrd-senya/following{/other_user}","gists_url":"https://api.github.com/users/cmrd-senya/gists{/gist_id}","starred_url":"https://api.github.com/users/cmrd-senya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmrd-senya/subscriptions","organizations_url":"https://api.github.com/users/cmrd-senya/orgs","repos_url":"https://api.github.com/users/cmrd-senya/repos","events_url":"https://api.github.com/users/cmrd-senya/events{/privacy}","received_events_url":"https://api.github.com/users/cmrd-senya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmrd-senya/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/cmrd-senya/diaspora","forks_url":"https://api.github.com/repos/cmrd-senya/diaspora/forks","keys_url":"https://api.github.com/repos/cmrd-senya/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmrd-senya/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmrd-senya/diaspora/teams","hooks_url":"https://api.github.com/repos/cmrd-senya/diaspora/hooks","issue_events_url":"https://api.github.com/repos/cmrd-senya/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/cmrd-senya/diaspora/events","assignees_url":"https://api.github.com/repos/cmrd-senya/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/cmrd-senya/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/cmrd-senya/diaspora/tags","blobs_url":"https://api.github.com/repos/cmrd-senya/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmrd-senya/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmrd-senya/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmrd-senya/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmrd-senya/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/cmrd-senya/diaspora/languages","stargazers_url":"https://api.github.com/repos/cmrd-senya/diaspora/stargazers","contributors_url":"https://api.github.com/repos/cmrd-senya/diaspora/contributors","subscribers_url":"https://api.github.com/repos/cmrd-senya/diaspora/subscribers","subscription_url":"https://api.github.com/repos/cmrd-senya/diaspora/subscription","commits_url":"https://api.github.com/repos/cmrd-senya/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmrd-senya/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmrd-senya/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmrd-senya/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmrd-senya/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/cmrd-senya/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmrd-senya/diaspora/merges","archive_url":"https://api.github.com/repos/cmrd-senya/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmrd-senya/diaspora/downloads","issues_url":"https://api.github.com/repos/cmrd-senya/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/cmrd-senya/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/cmrd-senya/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/cmrd-senya/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmrd-senya/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/cmrd-senya/diaspora/releases{/id}","deployments_url":"https://api.github.com/repos/cmrd-senya/diaspora/deployments","created_at":"2015-06-29T13:51:58Z","updated_at":"2016-04-01T15:23:28Z","pushed_at":"2016-09-16T11:28:22Z","git_url":"git://github.com/cmrd-senya/diaspora.git","ssh_url":"git@github.com:cmrd-senya/diaspora.git","clone_url":"https://github.com/cmrd-senya/diaspora.git","svn_url":"https://github.com/cmrd-senya/diaspora","homepage":"https://diasporafoundation.org/","size":99640,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"stable"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"960f39b6ff1806fdb5bd1058a56f03a9350e37f8","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"name":"diaspora","full_name":"diaspora/diaspora","owner":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diaspora/diaspora","description":"A privacy-aware, distributed, open source social network.","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","deployments_url":"https://api.github.com/repos/diaspora/diaspora/deployments","created_at":"2010-09-15T05:20:04Z","updated_at":"2016-09-23T15:52:01Z","pushed_at":"2016-09-23T00:51:12Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":246242,"stargazers_count":10902,"watchers_count":10902,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2786,"mirror_url":null,"open_issues_count":387,"forks":2786,"open_issues":387,"watchers":10902,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6818"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6818"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6818"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6818/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6818/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6818/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/e58269a2266b5d15c6184beafa15c88a60462610"}}}}
{"actor":{"display_login":"SuperTux88"}}