aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 92655cd035..e60311f8ab 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) before they are deleted
+ *
+ * @event core.delete_pm_before
+ * @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_before', compact($vars)));
+
// Get PM Information for later deleting
$sql = 'SELECT msg_id, pm_unread, pm_new
FROM ' . PRIVMSGS_TO_TABLE . '
@@ -1906,6 +1918,19 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
$phpbb_notifications->add_notifications('pm', $pm_data);
}
+ /**
+ * Get PM message ID after submission to DB
+ *
+ * @event core.submit_pm_after
+ * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit
+ * @var string subject Subject of the private message
+ * @var array data The whole row data of the PM.
+ * @var array pm_data The data sent to notification class
+ * @since 3.1.0-b5
+ */
+ $vars = array('mode', 'subject', 'data', 'pm_data');
+ extract($phpbb_dispatcher->trigger_event('core.submit_pm_after', compact($vars)));
+
return $data['msg_id'];
}