Scenario:
User A created Post 1 and is subscribed to his own post
User B is subscrbed to User A
User B is not subscribed to Post 1
User C commented on Post 1
System notifies User A (correct) and User B (not correct)
The reason I think notifying User B is not correct is because User B is only subscribed to User A and not to the post that User A created (Post 1).
"Subscribed" in this context means the email flag is on.
In function message_subscribe_get_basic_context(), particularly the code below,
// Default context for comments.
if ($entity_type == 'comment') {
$context['node'][$entity->nid] = $entity->nid;
$context['user'][$entity->uid] = $entity->uid;
}
... adds the entity the comment belongs to, subsequently also adding the 1) creator of the entity (correct), 2) subscribers of the entity (correct), as well as 3) the followers of the author of the entity (not correct).
I can't think of a "graceful" way to recode this at the moment.
Using hook_message_subscribe_get_subscribers_alter
It's possible to remove unnecessary UIDs (users that were included because they were subscribers of the author of the entity) by traversing the UIDs passed to the hook and doing some DB queries.
Closed: outdated
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.