[buddypress-trac] [BuddyPress Trac] #5389: Mark notifications as read when the item (blog post, private message thread and so on) is visited

buddypress-trac noreply at wordpress.org
Sat Feb 22 21:11:35 UTC 2014


#5389: Mark notifications as read when the item (blog post, private message thread
and so on) is visited
--------------------------+------------------------------
 Reporter:  henry.wright  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Core          |     Version:  1.9.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by henry.wright):

 With reference to ticket #4046, I'm sure we've had that conversation more
 than once before actually :)

 You got me thinking - When an at-mentions happens to be in a blog post,
 could we be cheeky and conditionally slip the blog post's ID into the
 item_id instead of the activity ID?

 For example, at the point of notification creation (please excuse the
 pseudo code):

 {{{
 is this at-mention in an activity item {
    $item_id = $activity->id;
 } else is this at-mention in a blog post {
    $item_id = $post->ID;
 }
 }}}

 The $item_id holds the value we need either way.

 {{{
 bp_notifications_add_notification( array(
     'user_id'           => $receiver_user_id,
     'item_id'           => $item_id,
     'secondary_item_id' => $activity->user_id,
     'component_name'    => buddypress()->activity->id,
     'component_action'  => 'new_at_mention',
     'date_notified'     => bp_core_current_time(),
     'is_new'            => 1,
 ) );
 }}}

 To my knowledge, having a ''flexible'' {{{item_id}}} which can hold either
 the activity ID or the blog post ID wouldn't have implications elsewhere.

 If I'm wrong and this will cause side-affects elsewhere, then I agree it's
 time to throw in the towel. As you say there are more ways to dismiss the
 notification and activity items aren't deleted often so although it's a
 failure, it isn't a huge failure :)

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


More information about the buddypress-trac mailing list