aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
authorStanislav Atanasov <lucifer@anavaro.com>2014-06-11 05:04:32 +0300
committerStanislav Atanasov <lucifer@anavaro.com>2014-06-22 22:03:00 +0300
commitcd31aea4beeb8075c199ad43c2d14e79e2a6955c (patch)
tree700b40be84a25ff7b8e63f696ea923030617363d /phpBB/includes/functions_privmsgs.php
parentb41a730471f2fad7a2466688d323c5563848c640 (diff)
downloadforums-cd31aea4beeb8075c199ad43c2d14e79e2a6955c.tar
forums-cd31aea4beeb8075c199ad43c2d14e79e2a6955c.tar.gz
forums-cd31aea4beeb8075c199ad43c2d14e79e2a6955c.tar.bz2
forums-cd31aea4beeb8075c199ad43c2d14e79e2a6955c.tar.xz
forums-cd31aea4beeb8075c199ad43c2d14e79e2a6955c.zip
[ticket/12691] Add core.delete_pm to funtion delete_pm
Add core.delete_pm to funtion delete_pm. Event will return: int $user_id - ID of the user requested the message delete array $msg_ids - array of all messages to be deleted int $folder_id - ID of the user folder where the messages are stored Justification: Allow extensions to capture this event and act as intended by ext author PHPBB3-12691
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 92655cd035..1fd4b1c98c 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -988,7 +988,7 @@ function handle_mark_actions($user_id, $mark_action)
*/
function delete_pm($user_id, $msg_ids, $folder_id)
{
- global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$user_id = (int) $user_id;
$folder_id = (int) $folder_id;
@@ -1012,6 +1012,18 @@ function delete_pm($user_id, $msg_ids, $folder_id)
return false;
}
+ /**
+ * Get all info for PM(s) that are to be deleted
+ *
+ * @event core.delete_pm
+ * @var int user_id ID of the user requested the message delete
+ * @var array msg_ids array of all messages to be deleted
+ * @var int folder_id ID of the user folder where the messages are stored
+ * @since 3.1.0-b5
+ */
+ $vars = array('user_id', 'msg_ids', 'folder_id');
+ extract($phpbb_dispatcher->trigger_event('core.delete_pm', compact($vars)));
+
// Get PM Information for later deleting
$sql = 'SELECT msg_id, pm_unread, pm_new
FROM ' . PRIVMSGS_TO_TABLE . '