[buddypress-trac] [BuddyPress Trac] #5130: Synchronizing activity comments to main component

buddypress-trac noreply at wordpress.org
Mon Mar 17 21:48:08 UTC 2014


#5130: Synchronizing activity comments to main component
-------------------------+--------------------
 Reporter:  r-a-y        |       Owner:  r-a-y
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.0
Component:  Core         |     Version:  1.2
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+--------------------

Comment (by r-a-y):

 `02.patch` is updated for trunk.

 This patch also addresses the lingering problems from the older patch.

 Specifically:
 1. Blog comment deletion and activity comment deletion.
 2. Checking the blog's threaded comment depth setting
 3. Fixes activity comment permalinks on AJAX

 So basically all the main issues are resolved in some manner.

 __1) Blog comment deletion and activity comment deletion__

 I've chosen to delete blog comments only if the blog comment is associated
 with an activity comment since BP doesn't have a 'status' field to toggle.

 I've also had to change a few things:
 - Activity deletion callback now uses the 'bp_activity_delete_comment_pre'
 filter instead of the bp_activity_delete_comment' action because I need
 access to the activity comment children.  'bp_activity_delete_comment' is
 too late.

 - Added utility function - bp_activity_recurse_comments_activity_ids() -
 to grab the activity IDs for an activity item

 - Added utility function - bp_blogs_remove_associated_blog_comments() -
 When an array of activity IDs are passed, this will try and find the blog
 comments that have an associated activity entry.  If there are matches,
 the blog comments are removed.

 __2) Checking the blog's threaded comment depth setting__

 This might overlap a bit with these tickets:
 https://buddypress.trac.wordpress.org/ticket/1870#comment:2
 https://buddypress.trac.wordpress.org/ticket/2768

 There are some other issues at play here:
 - If WP's threaded comments are later disabled, WP's comments are
 displayed flat.  However, BP's activity stream does not change.  If we
 wanted to mirror this, we'd need to rebuild the activity comment tree for
 each corresponding blog post.  Not very great.
 - If different blogs have different threaded depths, this will not make
 for a consistent appearance in the activity stream.  The question is
 whether we should even adopt WP's threaded depth setting?

 __3) Fixes activity comment permalinks on AJAX__

 My previous patch did not account for setting up the temporary globals
 when AJAX was used.

 This is now remedied in the new bp_blogs_setup_activity_loop_globals() and
 bp_blogs_setup_comment_loop_globals_on_ajax() functions.

 Feedback welcome.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5130#comment:14>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list