<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
return false;
}
- if ($msg['reply']) {
- $reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $msg['parent-uri'], 'reply' => false]);
-
+ if ($msg['reply'] && DBA::isResult($reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $msg['parent-uri'], 'reply' => false]))) {
$msg['thr-parent'] = $reply['uri'];
$msg['thr-parent-id'] = $reply['uri-id'];
} else {
'link' => DI::baseUrl() . '/message/' . $msg['id'],
];
- notification($notif_params);
+ DI::notify()->createFromArray($notif_params);
Logger::info('Mail is processed, notification was sent.', ['id' => $msg['id'], 'uri' => $msg['uri']]);
}
}
if (!$convid) {
- Logger::log('send message: conversation not found.');
+ Logger::notice('send message: conversation not found.');
return -4;
}
}
if (!$convid) {
- Logger::log('send message: conversation not found.');
+ Logger::notice('send message: conversation not found.');
return -4;
}