[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
This commit is contained in:
Stanislav Atanasov 2014-06-11 05:04:32 +03:00
parent b41a730471
commit cd31aea4be

View file

@ -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 . '