Skip to content

Commit 7a59b4f

Browse files
authored
Prevent notifications to Application user in new_follower (#2117)
1 parent b293f06 commit 7a59b4f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Stopp sending follow notifications to the Application user, since system-level accounts cannot be followed.

includes/class-mailer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ public static function comment_notification_text( $message, $comment_id ) {
126126
* @param int $user_id The id of the local blog-user.
127127
*/
128128
public static function new_follower( $activity, $user_id ) {
129+
// Do not send notifications to the Application user.
130+
if ( Actors::APPLICATION_USER_ID === $user_id ) {
131+
return;
132+
}
133+
129134
if ( $user_id > Actors::BLOG_USER_ID ) {
130135
if ( ! \get_user_option( 'activitypub_mailer_new_follower', $user_id ) ) {
131136
return;

0 commit comments

Comments
 (0)