From 5744cf55147ba7a8bb46fc10c8de06fc9dd8be50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=B3na=20Lore?= <lonalore@freemail.hu>
Date: Wed, 4 Mar 2015 16:25:36 +0100
Subject: [PATCH] Missing event triggering after sending to a single person.
 Append ID of inserted row to event data.

---
 e107_plugins/pm/pm_class.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php
index 6d1fb6420..6d258d21a 100755
--- a/e107_plugins/pm/pm_class.php
+++ b/e107_plugins/pm/pm_class.php
@@ -211,7 +211,8 @@ class private_message
 
 				if($pmid = $sql->insert('private_msg', $info))
 				{
-				  	e107::getEvent()->trigger('user_pm_sent', $info);
+					$info['pm_id'] = $pmid;
+					e107::getEvent()->trigger('user_pm_sent', $info);
 					if($class == FALSE)
 					{
 						$toclass .= $u['user_name'].', ';
@@ -244,6 +245,8 @@ class private_message
 			$info['pm_to'] = intval($vars['to_info']['user_id']);		// Sending to a single user now
 			if($pmid = $sql->insert('private_msg', $info))
 			{
+				$info['pm_id'] = $pmid;
+				e107::getEvent()->trigger('user_pm_sent', $info);
 				if(check_class($this->pmPrefs['notify_class'], $vars['to_info']['user_class']))
 				{
 					set_time_limit(30);