From 1ab0c469e253df0e01f358a4a86e1b6df290d740 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 14 Sep 2012 16:24:50 -0500 Subject: [PATCH] [ticket/11103] Delete notifications for PMs deleted by phpbb_delete_user_pms PHPBB3-11103 --- phpBB/includes/functions_privmsgs.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index dbf5df787f..133b6fc9bc 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1146,6 +1146,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) function phpbb_delete_user_pms($user_id) { global $db, $user, $phpbb_root_path, $phpEx; + global $phpbb_container; $user_id = (int) $user_id; @@ -1262,6 +1263,10 @@ function phpbb_delete_user_pms($user_id) WHERE folder_id = ' . PRIVMSGS_NO_BOX . ' AND ' . $db->sql_in_set('msg_id', $delivered_msg); $db->sql_query($sql); + + // Delete Notifications + $phpbb_notifications = $phpbb_container->get('notifications'); + $phpbb_notifications->delete_notifications('pm', $delivered_msg); } if (!empty($undelivered_msg)) @@ -1273,6 +1278,10 @@ function phpbb_delete_user_pms($user_id) $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); $db->sql_query($sql); + + // Delete Notifications + $phpbb_notifications = $phpbb_container->get('notifications'); + $phpbb_notifications->delete_notifications('pm', $undelivered_msg); } } @@ -1315,6 +1324,10 @@ function phpbb_delete_user_pms($user_id) $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $db->sql_query($sql); + + // Delete Notifications + $phpbb_notifications = $phpbb_container->get('notifications'); + $phpbb_notifications->delete_notifications('pm', $delete_ids); } }