Index: bp-activity/bp-activity-screens.php
===================================================================
--- bp-activity/bp-activity-screens.php
+++ bp-activity/bp-activity-screens.php
@@ -129,20 +129,6 @@ function bp_activity_screen_mentions() {
 }
 
 /**
- * Remove activity notifications when a user clicks on them.
- *
- * @since BuddyPress (1.5)
- *
- * @uses bp_core_mark_all_notifications_by_type()
- */
-function bp_activity_remove_screen_notifications() {
-	bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' );
-}
-add_action( 'bp_activity_screen_my_activity',               'bp_activity_remove_screen_notifications' );
-add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' );
-add_action( 'bp_activity_screen_mentions',                  'bp_activity_remove_screen_notifications' );
-
-/**
  * Reset the logged-in user's new mentions data when he visits his mentions screen.
  *
  * @since BuddyPress (1.5)
Index: bp-friends/bp-friends-cache.php
===================================================================
--- bp-friends/bp-friends-cache.php
+++ bp-friends/bp-friends-cache.php
@@ -28,16 +28,6 @@ function friends_clear_friend_object_cache( $friendship_id ) {
 	wp_cache_delete( 'friends_friend_ids_' .    $friendship->friend_user_id,    'bp' );
 }
 
-/**
- * Clear friend-related notifications when ?new=1.
- */
-function friends_clear_friend_notifications() {
-	if ( isset( $_GET['new'] ) ) {
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );
-	}
-}
-add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
-
 // List actions to clear object caches on
 add_action( 'friends_friendship_accepted', 'friends_clear_friend_object_cache' );
 add_action( 'friends_friendship_deleted',  'friends_clear_friend_object_cache' );
Index: bp-friends/bp-friends-functions.php
===================================================================
--- bp-friends/bp-friends-functions.php
+++ bp-friends/bp-friends-functions.php
@@ -118,9 +118,6 @@ function friends_accept_friendship( $friendship_id ) {
 	if ( !$friendship->is_confirmed && BP_Friends_Friendship::accept( $friendship_id ) ) {
 		friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id );
 
-		// Remove the friend request notice
-		bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
-
 		// Add a friend accepted notice for the initiating user
 		bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' );
 
@@ -170,9 +167,6 @@ function friends_reject_friendship( $friendship_id ) {
 
 	if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) {
 
-		// Remove the friend request notice
-		bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
-
 		do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) );
 		return true;
 	}
@@ -195,9 +189,6 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) {
 	$friendship    = new BP_Friends_Friendship( $friendship_id, true, false );
 
 	if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) {
-		// Remove the friend request notice
-		bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' );
-
 		do_action_ref_array( 'friends_friendship_whithdrawn', array( $friendship_id, &$friendship ) );
 		return true;
 	}
@@ -575,9 +566,6 @@ function friends_remove_data( $user_id ) {
 	// Remove usermeta
 	bp_delete_user_meta( $user_id, 'total_friend_count' );
 
-	// Remove friendship requests FROM user
-	bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' );
-
 	do_action( 'friends_remove_data', $user_id );
 }
 add_action( 'wpmu_delete_user',  'friends_remove_data' );
Index: bp-friends/bp-friends-screens.php
===================================================================
--- bp-friends/bp-friends-screens.php
+++ bp-friends/bp-friends-screens.php
@@ -18,10 +18,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * Catch and process the My Friends page.
  */
 function friends_screen_my_friends() {
-
-	// Delete any friendship acceptance notifications for the user when viewing a profile
-	bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );
-
 	do_action( 'friends_screen_my_friends' );
 
 	bp_core_load_template( apply_filters( 'friends_template_my_friends', 'members/single/home' ) );
@@ -67,10 +63,6 @@ function friends_screen_requests() {
 
 	do_action( 'friends_screen_requests' );
 
-	if ( isset( $_GET['new'] ) ) {
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' );
-	}
-
 	bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
 }
 
Index: bp-groups/bp-groups-functions.php
===================================================================
--- bp-groups/bp-groups-functions.php
+++ bp-groups/bp-groups-functions.php
@@ -216,9 +216,6 @@ function groups_delete_group( $group_id ) {
 	// Remove all outstanding invites for this group
 	groups_delete_all_group_invites( $group_id );
 
-	// Remove all notifications for any user belonging to this group
-	bp_core_delete_all_notifications_by_type( $group_id, $bp->groups->id );
-
 	do_action( 'groups_delete_group', $group_id);
 
 	return true;
@@ -718,8 +715,6 @@ function groups_accept_invite( $user_id, $group_id ) {
 	// Modify group meta
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
 
-	bp_core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' );
-
 	do_action( 'groups_accept_invite', $user_id, $group_id );
 	return true;
 }
@@ -737,9 +732,7 @@ function groups_delete_invite( $user_id, $group_id ) {
 
 	$delete = BP_Groups_Member::delete_invite( $user_id, $group_id );
 
-	if ( !empty( $delete ) ) {
-		bp_core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' );
-	}
+	do_action( 'groups_delete_invite', $user_id, $group_id, $delete );
 
 	return $delete;
 }
@@ -1078,8 +1071,6 @@ function groups_remove_data_for_user( $user_id ) {
 
 	BP_Groups_Member::delete_all_for_user( $user_id );
 
-	bp_core_delete_notifications_from_user( $user_id, $bp->groups->id, 'new_membership_request' );
-
 	do_action( 'groups_remove_data_for_user', $user_id );
 }
 add_action( 'wpmu_delete_user',  'groups_remove_data_for_user' );
Index: bp-groups/bp-groups-screens.php
===================================================================
--- bp-groups/bp-groups-screens.php
+++ bp-groups/bp-groups-screens.php
@@ -26,17 +26,6 @@ function groups_directory_groups_setup() {
 add_action( 'bp_screens', 'groups_directory_groups_setup', 2 );
 
 function groups_screen_my_groups() {
-
-	$bp = buddypress();
-
-	// Delete group request notifications for the user
-	if ( isset( $_GET['n'] ) ) {
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
-	}
-
 	do_action( 'groups_screen_my_groups' );
 
 	bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) );
@@ -93,9 +82,6 @@ function groups_screen_group_invites() {
 		bp_core_redirect( $redirect_to );
 	}
 
-	// Remove notifications
-	bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' );
-
 	do_action( 'groups_screen_group_invites', $group_id );
 
 	bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) );
@@ -106,15 +92,6 @@ function groups_screen_group_home() {
 	if ( ! bp_is_single_item() )
 		return false;
 
-	$bp = buddypress();
-
-	if ( isset( $_GET['n'] ) ) {
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
-		bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
-	}
-
 	do_action( 'groups_screen_group_home' );
 
 	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
@@ -812,9 +789,6 @@ function groups_screen_group_admin_requests() {
 	if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) )
 		return false;
 
-	// Remove any screen notifications
-	bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' );
-
 	$request_action = (string)bp_action_variable( 1 );
 	$membership_id  = (int)bp_action_variable( 2 );
 
Index: bp-members/bp-members-notifications.php
===================================================================
--- bp-members/bp-members-notifications.php
+++ bp-members/bp-members-notifications.php
@@ -105,13 +105,19 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) {
 	return apply_filters( 'bp_core_get_notifications_for_user', $renderable, $user_id, $format );
 }
 
-/** Delete ********************************************************************/
+/** Mark ****************************************************************/
 
 /**
- * Delete notifications for a user by type
+ * Mark notifications for a user by type.
+ *
+ * Previously, we used to delete notifications by default, but due to changes
+ * in BuddyPress 1.9, we need to make sure notifications are marked as read
+ * instead.
+ *
+ * Plugin developers new to BuddyPress should use the notification functions
+ * located in /bp-notifications/bp-notification-functions.php instead.
  *
- * Used when clearing out notifications for a specific component when the user
- * has visited that component.
+ * @deprecated BuddyPress (1.9)
  *
  * @since BuddyPress (1.0)
  * @param int $user_id
@@ -126,14 +132,20 @@ function bp_core_delete_notifications_by_type( $user_id, $component_name, $compo
 		return false;
 	}
 
-	return bp_notifications_delete_notifications_by_type( $user_id, $component_name, $component_action );
+	return bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action );
 }
 
 /**
- * Delete notifications for an item ID
+ * Mark notifications for an item ID
+ *
+ * Previously, we used to delete notifications by default, but due to changes
+ * in BuddyPress 1.9, we need to make sure notifications are marked as read
+ * instead.
+ *
+ * Plugin developers new to BuddyPress should use the notification functions
+ * located in /bp-notifications/bp-notification-functions.php instead.
  *
- * Used when clearing out notifications for a specific component when the user
- * has visited that component.
+ * @deprecated BuddyPress (1.9)
  *
  * @since BuddyPress (1.0)
  * @param int $user_id
@@ -148,32 +160,20 @@ function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component
 		return false;
 	}
 
-	return bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
+	return bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id );
 }
 
 /**
- * Delete all notifications for by type
+ * Mark all notifications by type.
  *
- * @since BuddyPress (1.0)
- * @param int $user_id
- * @param string $component_name
- * @param string $component_action
- * @return boolean True on success, false on fail
- */
-function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
-
-	// Bail if notifications is not active
-	if ( ! bp_is_active( 'notifications' ) ) {
-		return false;
-	}
-
-	bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
-}
-
-/**
- * Delete all notifications for a user
+ * Previously, we used to delete notifications by default, but due to changes
+ * in BuddyPress 1.9, we need to make sure notifications are marked as read
+ * instead.
  *
- * Used when clearing out all notifications for a user, whene deleted or spammed
+ * Plugin developers new to BuddyPress should use the notification functions
+ * located in /bp-notifications/bp-notification-functions.php instead.
+ *
+ * @deprecated BuddyPress (1.9)
  *
  * @since BuddyPress (1.0)
  * @param int $user_id
@@ -181,103 +181,52 @@ function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $c
  * @param string $component_action
  * @return boolean True on success, false on fail
  */
-function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
+function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) {
 
 	// Bail if notifications is not active
 	if ( ! bp_is_active( 'notifications' ) ) {
 		return false;
 	}
 
-	return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action );
+	return bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id );
 }
 
-/** Mark **********************************************************************/
+/** Delete ********************************************************************/
 
 /**
- * Delete notifications for a user by type
+ * To delete notifications, please use the delete functions located in:
  *
- * Used when clearing out notifications for a specific component when the user
- * has visited that component.
+ *     /bp-notifications/bp-notifications-functions.php
  *
- * @since BuddyPress (1.9.0)
- * @param int $user_id
- * @param string $component_name
- * @param string $component_action
- * @param int $is_new
- * @return boolean True on success, false on fail
+ * @see bp_notifications_delete_notifications_by_type()
+ * @see bp_notifications_delete_notifications_by_item_id()
+ * @see bp_notifications_delete_all_notifications_by_type()
+ * @see bp_notifications_delete_notifications_from_user()
  */
-function bp_core_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) {
-
-	// Bail if notifications is not active
-	if ( ! bp_is_active( 'notifications' ) ) {
-		return false;
-	}
-
-	return bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new );
-}
 
 /**
- * Delete notifications for an item ID
- *
- * Used when clearing out notifications for a specific component when the user
- * has visited that component.
+ * Delete all notifications for a user
  *
- * @since BuddyPress (1.9.0)
- * @param int $user_id
- * @param string $component_name
- * @param string $component_action
- * @param int $is_new
- * @return boolean True on success, false on fail
- */
-function bp_core_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) {
-
-	// Bail if notifications is not active
-	if ( ! bp_is_active( 'notifications' ) ) {
-		return false;
-	}
-
-	return bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id, $is_new );
-}
-
-/**
- * Mark all notifications read/unread for by type
+ * Used when clearing out all notifications for a user, whene deleted or spammed
  *
- * Used when clearing out notifications for an entire component
+ * @deprecated BuddyPress (1.9)
  *
- * @since BuddyPress (1.9.0)
+ * @since BuddyPress (1.0)
  * @param int $user_id
  * @param string $component_name
  * @param string $component_action
  * @return boolean True on success, false on fail
  */
-function bp_core_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) {
+function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
 
 	// Bail if notifications is not active
 	if ( ! bp_is_active( 'notifications' ) ) {
 		return false;
 	}
 
-	bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id, $is_new );
+	return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action );
 }
 
-/**
- * Mark all notifications read/unread from a user
- *
- * @since BuddyPress (1.9.0)
- * @param int $user_id
- * @param string $component_name
- * @param string $component_action
- * @return boolean True on success, false on fail
- */
-function bp_core_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) {
-
-	// Bail if notifications is not active
-	if ( ! bp_is_active( 'notifications' ) ) {
-		return false;
-	}
-
-	return bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new );
-}
 
 /** Helpers *******************************************************************/
 
Index: bp-messages/bp-messages-template.php
===================================================================
--- bp-messages/bp-messages-template.php
+++ bp-messages/bp-messages-template.php
@@ -184,9 +184,6 @@ function bp_has_message_threads( $args = '' ) {
 	if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) {
 		wp_redirect( bp_displayed_user_id() );
 	} else {
-		if ( bp_is_current_action( 'inbox' ) ) {
-			bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );
-		}
 
 		if ( bp_is_current_action( 'sentbox' ) ) {
 			$box = 'sentbox';
Index: bp-notifications/bp-notifications-actions.php
===================================================================
--- bp-notifications/bp-notifications-actions.php
+++ bp-notifications/bp-notifications-actions.php
@@ -121,3 +121,199 @@ function bp_notifications_action_delete() {
 	bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/' . bp_current_action() . '/' );
 }
 add_action( 'bp_actions', 'bp_notifications_action_delete' );
+
+
+/** BP COMPONENTS *******************************************************/
+
+/**
+ * Remove activity notifications when a user clicks on them.
+ *
+ * @since BuddyPress (1.5)
+ *
+ * @uses bp_notifications_mark_all_notifications_by_type()
+ */
+function bp_activity_remove_screen_notifications() {
+	bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' );
+}
+add_action( 'bp_activity_screen_my_activity',               'bp_activity_remove_screen_notifications' );
+add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' );
+add_action( 'bp_activity_screen_mentions',                  'bp_activity_remove_screen_notifications' );
+
+/**
+ * Clear friend-related notifications when ?new=1.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friend_notifications() {
+	if ( isset( $_GET['new'] ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );
+	}
+}
+add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
+
+/**
+ * Clear any friendship acceptance notifications for the user when viewing a profile.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friendship_accepted_notifications() {
+	bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );
+}
+add_action( 'friends_screen_my_friends', 'friends_clear_friendship_accepted_notifications' );
+
+/**
+ * Clear any friendship request notifications for the user.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friendship_request_notifications() {
+	if ( isset( $_GET['new'] ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' );
+	}
+}
+add_action( 'friends_screen_requests', 'friends_clear_friendship_request_notifications' );
+
+/**
+ * Clear any friendship request notifications for the user when friendship is
+ * accepted.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friendship_request_notifications_on_accept( $friendship_id, $initiator_user_id, $friend_user_id ) {
+	bp_notifications_mark_notifications_by_item_id( $friend_user_id, $initiator_user_id, buddypress()->friends->id, 'friendship_request' );
+}
+add_action( 'friends_friendship_accepted', 'friends_clear_friendship_request_notifications_on_accept', 10, 3 );
+
+/**
+ * Clear any friendship request notifications for the user when friendship is
+ * rejected.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friendship_request_notifications_on_reject( $friendship_id, $friendship ) {
+	bp_notifications_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, buddypress()->friends->id, 'friendship_request' );
+}
+add_action( 'friends_friendship_rejected', 'friends_clear_friendship_request_notifications_on_reject', 10, 2 );
+
+/**
+ * Clear any friendship request notifications for the user when friendship is
+ * rejected.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_clear_friendship_request_notifications_on_withdraw( $friendship_id, $friendship ) {
+	bp_notifications_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, buddypress()->friends->id, 'friendship_request' );
+}
+add_action( 'friends_friendship_whithdrawn', 'friends_clear_friendship_request_notifications_on_withdraw', 10, 2 );
+
+/**
+ * Clear any friendship request notifications by a deleted user.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function friends_remove_notifications_for_user( $user_id = 0 ) {
+	bp_notifications_delete_notifications_from_user( $user_id, buddypress()->friends->id, 'friendship_request' );
+}
+add_action( 'friends_remove_data', 'friends_remove_notifications_for_user' );
+
+/**
+ * Clear any group-related notifications for the user when viewing their groups.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_my_groups_notifications() {
+	$bp = buddypress();
+
+	// Delete group request notifications for the user
+	if ( isset( $_GET['n'] ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
+	}
+}
+add_action( 'groups_screen_my_groups', 'groups_clear_my_groups_notifications' );
+
+/**
+ * Clear any group invite notifications for the user when viewing their group
+ * invites page.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_my_invites_notifications() {
+	bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' );
+}
+add_action( 'groups_screen_group_invites', 'groups_clear_invites_notifications' );
+
+/**
+ * Clear single group notifications for the user when viewing a group page.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_single_group_notifications() {
+	$bp = buddypress();
+
+	if ( isset( $_GET['n'] ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod'      );
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin'    );
+	}
+}
+add_action( 'groups_screen_group_home', 'groups_clear_single_group_notifications' );
+
+/**
+ * Clear a group's membership request notifications for the group admin.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_request_notifications() {
+	bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'new_membership_request' );
+}
+add_action( 'groups_group_request_managed',       'groups_clear_request_notifications' );
+add_action( 'groups_screen_group_admin_requests', 'groups_clear_request_notifications' );
+
+/**
+ * Clear a user's group invite notifications.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_group_invites_notifications( $user_id = 0, $group_id = 0, $delete = true ) {
+	bp_notifications_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' );
+}
+add_action( 'groups_accept_invite', 'groups_clear_group_invites_notifications', 10, 2 );
+add_action( 'groups_delete_invite', 'groups_clear_group_invites_notifications', 10, 3 );
+
+/**
+ * Clear all group notifications when a group is deleted.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_notifications_for_group( $group_id = 0 ) {
+	bp_notifications_delete_all_notifications_by_type( $group_id, buddypress()->groups->id );
+}
+add_action( 'groups_delete_group', 'groups_clear_notifications_for_group' );
+
+/**
+ * Clear all group notifications when a user is deleted.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function groups_clear_notifications_for_user( $user_id = 0 ) {
+	bp_notifications_delete_notifications_from_user( $user_id, buddypress()->groups->id, 'new_membership_request' );
+}
+add_action( 'groups_remove_data_for_user', 'groups_clear_notifications_for_user' );
+
+/**
+ * Clear notifications when user is in the PM inbox.
+ *
+ * @todo Perhaps fire this on 'messages_screen_inbox' instead?
+ */
+function messages_clear_notifications_on_inbox( $retval ) {
+	if ( bp_is_current_action( 'inbox' ) ) {
+		bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->messages->id, 'new_message' );
+	}
+
+	return $retval;
+}
+add_filter( 'bp_has_message_threads', 'messages_clear_notifications_on_inbox' );
\ No newline at end of file
