Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion message_subscribe.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,20 @@ function hook_message_subscribe_get_subscribers(MessageInterface $message, array
* A keyed array of values containing:
* - 'context' - The context array.
* - 'entity_type' - The entity type ID.
* - 'entity' - The entity object
* - 'entity' - The entity object.
* - 'message' - The Message entity.
* - 'subscribe_options' - The subscribe options array.
*/
function hook_message_subscribe_get_subscribers_alter(array &$uids, array $values) {
// Don't send message to original comment author.
if ($values['entity_type'] != 'comment') {
// Entity is not a comment.
return;
}

/** @var \Drupal\comment\CommentInterface $comment */
$comment = $values['entity'];
unset($uids[$comment->getOwnerId()]);
}

/**
Expand Down