Skip to:
Content

BuddyPress.org

Changeset 6008


Ignore:
Timestamp:
04/25/2012 09:25:21 PM (12 years ago)
Author:
djpaul
Message:

Fix new comment activity item not being marked as spam if comment was (i.e. by Akismet). Fixes #4164

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r5927 r6008  
    230230 *
    231231 * @param int $comment_id
    232  * @param bool $is_approved
     232 * @param mixed $is_approved
    233233 * @return mixed
    234234 */
    235235function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
    236 
    237236    // Get the users comment
    238237    $recorded_comment = get_comment( $comment_id );
     
    244243    // Don't record activity if no email address has been included
    245244    if ( empty( $recorded_comment->comment_author_email ) )
     245        return false;
     246
     247    // Don't record activity if the comment has already been marked as spam
     248    if ( 'spam' === $is_approved )
    246249        return false;
    247250
     
    431434add_action( 'delete_comment', 'bp_blogs_remove_comment' );
    432435
    433 
    434436/**
    435437 * When a blog comment status transition occurs, update the relevant activity's status.
Note: See TracChangeset for help on using the changeset viewer.