diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index 9e5ab42..3e7ac28 100644
|
|
|
function bp_activity_find_mentions( $content ) { |
| 132 | 132 | function bp_activity_clear_new_mentions( $user_id ) { |
| 133 | 133 | bp_delete_user_meta( $user_id, 'bp_new_mention_count' ); |
| 134 | 134 | bp_delete_user_meta( $user_id, 'bp_new_mentions' ); |
| | 135 | |
| | 136 | /** |
| | 137 | * Fires once mentions has been cleared for a given user. |
| | 138 | * |
| | 139 | * @since ? |
| | 140 | * |
| | 141 | * @param int $user_id |
| | 142 | */ |
| | 143 | do_action( 'bp_activity_clear_new_mentions', $user_id ); |
| 135 | 144 | } |
| 136 | 145 | |
| 137 | 146 | /** |
diff --git src/bp-activity/bp-activity-notifications.php src/bp-activity/bp-activity-notifications.php
index e2b233c..542726c 100644
|
|
|
add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notifi |
| 501 | 501 | * |
| 502 | 502 | * @uses bp_notifications_mark_all_notifications_by_type() |
| 503 | 503 | */ |
| 504 | | function bp_activity_remove_screen_notifications() { |
| | 504 | function bp_activity_remove_screen_notifications( $user_id = 0 ) { |
| 505 | 505 | if ( ! bp_is_active( 'notifications' ) ) { |
| 506 | 506 | return; |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | // Only mark read if you're looking at your own mentions. |
| 510 | | if ( ! bp_is_my_profile() ) { |
| 511 | | return; |
| | 510 | if ( bp_is_my_profile() || (int) $user_id === (int) bp_loggedin_user_id() ) { |
| | 511 | bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); |
| 512 | 512 | } |
| 513 | | |
| 514 | | bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); |
| 515 | 513 | } |
| 516 | | add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' ); |
| | 514 | add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications', 10, 0 ); |
| | 515 | add_action( 'bp_activity_clear_new_mentions', 'bp_activity_remove_screen_notifications', 10, 1 ); |
| 517 | 516 | |
| 518 | 517 | /** |
| 519 | 518 | * Mark at-mention notification as read when user visits the activity with the mention. |