X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=06542bbaf24708f507448f88f817cc9c6aa4c755;hb=7789ea25079801ee1425368e9bf2f7ce80d16d88;hp=80eac343ed517ccf9bc597d0129978d548c190a6;hpb=818c064c0a5d75b25e1977d336e319e8e9464577;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 80eac343ed..06542bbaf2 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,6 +1,6 @@ $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, @@ -385,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`, @@ -452,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']);