Merge pull request #9148 from annando/issue-9142
Issue 9142: Make the message ID look more like a message ID
This commit is contained in:
commit
ee13d074e0
|
@ -509,7 +509,8 @@ function notification($params)
|
||||||
Logger::log('sending notification email');
|
Logger::log('sending notification email');
|
||||||
|
|
||||||
if (isset($params['parent']) && (intval($params['parent']) != 0)) {
|
if (isset($params['parent']) && (intval($params['parent']) != 0)) {
|
||||||
$id_for_parent = $params['parent'] . "@" . $hostname;
|
$parent = Item::selectFirst(['guid'], ['id' => $params['parent']]);
|
||||||
|
$message_id = "<" . $parent['guid'] . "@" . gethostname() . ">";
|
||||||
|
|
||||||
// Is this the first email notification for this parent item and user?
|
// Is this the first email notification for this parent item and user?
|
||||||
if (!DBA::exists('notify-threads', ['master-parent-item' => $params['parent'], 'receiver-uid' => $params['uid']])) {
|
if (!DBA::exists('notify-threads', ['master-parent-item' => $params['parent'], 'receiver-uid' => $params['uid']])) {
|
||||||
|
@ -520,13 +521,13 @@ function notification($params)
|
||||||
'receiver-uid' => $params['uid'], 'parent-item' => 0];
|
'receiver-uid' => $params['uid'], 'parent-item' => 0];
|
||||||
DBA::insert('notify-threads', $fields);
|
DBA::insert('notify-threads', $fields);
|
||||||
|
|
||||||
$additional_mail_header .= "Message-ID: <${id_for_parent}>\n";
|
$additional_mail_header .= "Message-ID: " . $message_id . "\n";
|
||||||
$log_msg = "include/enotify: No previous notification found for this parent:\n" .
|
$log_msg = "include/enotify: No previous notification found for this parent:\n" .
|
||||||
" parent: ${params['parent']}\n" . " uid : ${params['uid']}\n";
|
" parent: ${params['parent']}\n" . " uid : ${params['uid']}\n";
|
||||||
Logger::log($log_msg, Logger::DEBUG);
|
Logger::log($log_msg, Logger::DEBUG);
|
||||||
} else {
|
} else {
|
||||||
// If not, just "follow" the thread.
|
// If not, just "follow" the thread.
|
||||||
$additional_mail_header .= "References: <${id_for_parent}>\nIn-Reply-To: <${id_for_parent}>\n";
|
$additional_mail_header .= "References: " . $message_id . "\nIn-Reply-To: " . $message_id . "\n";
|
||||||
Logger::log("There's already a notification for this parent.", Logger::DEBUG);
|
Logger::log("There's already a notification for this parent.", Logger::DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user