Making WordPress.org


Ignore:
Timestamp:
02/19/2014 02:37:07 PM (12 years ago)
Author:
nacin
Message:

Trac Notifications: Ignore CCs when calculating ticket participants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php

    r376 r402  
    8585
    8686    function get_trac_ticket_participants( $ticket_id ) {
    87         return $this->trac->get_col( $this->trac->prepare( "SELECT DISTINCT author FROM ticket_change WHERE ticket = %d", $ticket_id ) );
     87        // Make sure we suppress CC-only comments that still exist in the database.
     88        // Do this by suppressing any 'cc' changes and also any empty comments (used by Trac for comment numbering).
     89        // Empty comments are also used for other property changes made without comment, but those changes will still be returned by this query.
     90        $ignore_cc = "field <> 'cc' AND NOT (field = 'comment' AND newvalue = '') AND";
     91        return $this->trac->get_col( $this->trac->prepare( "SELECT DISTINCT author FROM ticket_change WHERE $ignore_cc ticket = %d", $ticket_id ) );
    8892    }
    8993
Note: See TracChangeset for help on using the changeset viewer.