Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification sent to wrong User #1530

Closed
lianglee opened this issue Nov 22, 2019 · 0 comments
Closed

Notification sent to wrong User #1530

lianglee opened this issue Nov 22, 2019 · 0 comments

Comments

@lianglee
Copy link
Member

There is a post with few comments. [post_guid: 1]

  1. User A Commented [annotation:1]
  2. User B commented [annotation:2]
  3. User C commented [annotation:3]

There is a post [post_guid:3]
1.User A commented [annotation:xx]

Now when someone likes the annotation:3, it will notify user C which is normal. But what not normal is it will also notify user A , because:

$paricipates = $this->get_comments_participates($subject_guid);
[get_comments_participates will search notifications where type: comment:post] and when subject type : annotation is liked with subject_guid 3 , it will mixup the annotation_id with post id. Resulting in returning wrong participates

So we need to check also like:annotation

//notify participates
if($type !== 'like:post' && $type !== 'like:annotation') {//}}

Further there is unused code in OssnNotification:add()

if($poster_guid == $guid_two) {} 
There is no $guid_two within  add() 
lianglee added a commit that referenced this issue Nov 22, 2019
githubertus added a commit to githubertus/opensource-socialnetwork that referenced this issue Nov 25, 2019
replacing former hardcoded condition that was taking care of excluding participant records in some cases (currently likes and mentions)
corresponding hook code for 'like:post' and 'like:annotation' are added to OssnLikes com file (opensource-socialnetwork#1530)
(will leave Bryce Alvord a note to add a similar hook to his MentionUser component)

2. get_comments_participates()
enhancement to allow participant records for ANY type of posting comment, not only 'comments:post'
githubertus added a commit to githubertus/opensource-socialnetwork that referenced this issue Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant