Skip to:
Content

BuddyPress.org

Changeset 1296


Ignore:
Timestamp:
04/02/2009 10:27:36 AM (15 years ago)
Author:
apeatling
Message:

Fixes #631

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r1295 r1296  
    295295        break;
    296296        case 'new_blog_post':
    297             $post = new BP_Blogs_Post($secondary_item_id);
     297            $post = new BP_Blogs_Post( $item_id );
    298298           
    299299            if ( !$post )
     
    456456            bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() );
    457457           
    458             $is_private = bp_blogs_is_blog_hidden( $recorded_post->blog_id );
    459            
    460             if ( $recorded_post->date_created >= strtotime( "-24 hours" ) ) {
     458            if ( strtotime( $recorded_post->date_created ) >= strtotime( "-24 hours" ) ) {
    461459                // Record in activity streams, but only if the post is 30 minutes
    462460                // old or less (stops old posts registering as new posts in activity streams when a comment is posted on them)
    463                 bp_blogs_record_activity( array( 'item_id' => $recorded_post->blog_id, 'secondary_item_id' => $recorded_post_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => $is_private, 'user_id' => $recorded_post->user_id ) );
     461                bp_blogs_record_activity( array( 'item_id' => $recorded_post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), 'user_id' => $recorded_post->user_id ) );
    464462            }
    465463        }
     
    485483       
    486484        $recorded_post = $existing_post;
     485
     486        /* Delete and re-add the activity stream item to reflect potential content changes. */
     487        if ( strtotime( $recorded_post->date_created ) >= strtotime( "-24 hours" ) ) {
     488            bp_blogs_delete_activity( array( 'item_id' => $recorded_post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'user_id' => $recorded_post->user_id ) );
     489            bp_blogs_record_activity( array( 'item_id' => $recorded_post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), 'user_id' => $recorded_post->user_id ) );
     490        }
    487491    }
    488492
Note: See TracChangeset for help on using the changeset viewer.