Making WordPress.org


Ignore:
Timestamp:
01/23/2015 11:49:51 PM (10 years ago)
Author:
nacin
Message:

Avoid sending mention notifications for people specifically watching or already subscribed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/mentions-handler.php

    r1184 r1187  
    5959
    6060add_filter( 'wporg_notifications_notify_username', function( $notify, $username ) use ( $type, $payload, $wpdb ) {
    61     // Core Trac has notifications configured, see if the user has blocked the ticket.
     61    // Core Trac has notifications configured.
    6262    if ( $payload->trac === 'core' ) {
     63        // See if the user has blocked the ticket, are watching it already, or have already been mentioned.
    6364        $status = wporg_get_trac_ticket_subscription_status( $username, $payload->ticket_id );
    64         if ( BLOCKED === $status ) {
     65        if ( BLOCKED === $status || SUBSCRIBED === $status || MENTIONED === $status ) {
    6566            return false;
    6667        }
Note: See TracChangeset for help on using the changeset viewer.