X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=06542bbaf24708f507448f88f817cc9c6aa4c755;hb=7789ea25079801ee1425368e9bf2f7ce80d16d88;hp=4f680aa0b7b7ebd448eecb65c3df326a1d8c6f77;hpb=bca6d9b0896e174e6a0704359d5d92aff8ef84db;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 4f680aa0b7..06542bbaf2 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,6 +1,6 @@ 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]); - DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['id'], 'uid' => local_user()]); } else { $messages = false; } @@ -333,7 +331,7 @@ function message_content(App $a) 'id' => $message['id'], 'from_name' => $from_name_e, 'from_url' => $from_url, - 'from_addr' => $contact['addr'], + 'from_addr' => $contact['addr'] ?? $from_url, 'sparkle' => $sparkle, 'from_photo' => $from_photo, 'subject' => $subject_e, @@ -386,7 +384,7 @@ function message_content(App $a) * @param int $limit * @return array */ -function get_messages($uid, $start, $limit) +function get_messages(int $uid, int $start, int $limit) { return DBA::toArray(DBA::p('SELECT m.`id`, @@ -453,6 +451,11 @@ function render_messages(array $msg, $t) $body_e = $rr['body']; $to_name_e = $rr['name']; + if (is_null($rr['url'])) { + // contact-id is pointing to a non existing contact + continue; + } + $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']); $from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']);