[ticket/12690] Add core.submit_pm_after event

Add core.submit_pm_after to funtion submit_pm.
Event will return just submited msg_id. It should be plased
just before return $data['msg_id'];

Justification:
Using only core.submit_pm_before does not allow to
follow up after message submission.
The message ID is recieved at DB submission.
Some times we need the MSG_ID as identifier

PHPBB3-12690
This commit is contained in:
Stanislav Atanasov 2014-06-11 03:27:14 +03:00
parent b41a730471
commit e05df3bf3d

View file

@ -1906,6 +1906,17 @@ 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 int msg_id message ID
* @since 3.1.0-b5
*/
$msg_id = $data['msg_id'];
$vars = array('msg_id');
extract($phpbb_dispatcher->trigger_event('core.submit_pm_after', compact($vars)));
return $data['msg_id'];
}