mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
[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:
parent
b41a730471
commit
cd31aea4be
1 changed files with 13 additions and 1 deletions
|
@ -988,7 +988,7 @@ function handle_mark_actions($user_id, $mark_action)
|
||||||
*/
|
*/
|
||||||
function delete_pm($user_id, $msg_ids, $folder_id)
|
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;
|
$user_id = (int) $user_id;
|
||||||
$folder_id = (int) $folder_id;
|
$folder_id = (int) $folder_id;
|
||||||
|
@ -1012,6 +1012,18 @@ function delete_pm($user_id, $msg_ids, $folder_id)
|
||||||
return false;
|
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
|
// Get PM Information for later deleting
|
||||||
$sql = 'SELECT msg_id, pm_unread, pm_new
|
$sql = 'SELECT msg_id, pm_unread, pm_new
|
||||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||||
|
|
Loading…
Add table
Reference in a new issue