mirror of
https://github.com/friendica/friendica
synced 2025-04-26 20:30:11 +00:00
API: improved mail handling
This commit is contained in:
parent
3c8a08840b
commit
6fe916a390
10 changed files with 91 additions and 23 deletions
|
@ -71,6 +71,20 @@ class Mail
|
|||
return false;
|
||||
}
|
||||
|
||||
$msg['author-id'] = Contact::getIdForURL($msg['from-url'], 0, false);
|
||||
$msg['uri-id'] = ItemURI::insert(['uri' => $msg['uri'], 'guid' => $msg['guid']]);
|
||||
$msg['parent-uri-id'] = ItemURI::getIdByURI($msg['parent-uri']);
|
||||
|
||||
if ($msg['reply']) {
|
||||
$reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
|
||||
|
||||
$msg['thr-parent'] = $reply['uri'];
|
||||
$msg['thr-parent-id'] = $reply['uri-id'];
|
||||
} else {
|
||||
$msg['thr-parent'] = $msg['uri'];
|
||||
$msg['thr-parent-id'] = $msg['uri-id'];
|
||||
}
|
||||
|
||||
DBA::insert('mail', $msg);
|
||||
|
||||
$msg['id'] = DBA::lastInsertId();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue