X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FMail.php;h=2670a5885f2d8ef57dde74d9fcc0dd723b0ab020;hb=b3f71d174c2f64d4bb527a6343cc4ba88f410a42;hp=67d5d1ddca3371a9152ccce1bffe7ae3c369410d;hpb=dd85f48e0de68aa71cb46ff067bd872f0f97ee1e;p=friendica.git diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 67d5d1ddca..2670a5885f 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -84,19 +84,12 @@ class Mail // send notifications. $notif_params = [ - 'type' => Type::MAIL, - 'notify_flags' => $user['notify-flags'], - 'language' => $user['language'], - 'to_name' => $user['username'], - 'to_email' => $user['email'], - 'uid' => $user['uid'], - 'item' => $msg, - 'parent' => $msg['id'], - 'source_name' => $msg['from-name'], - 'source_link' => $msg['from-url'], - 'source_photo' => $msg['from-photo'], - 'verb' => Activity::POST, - 'otype' => 'mail' + 'type' => Type::MAIL, + 'otype' => Notify\ObjectType::MAIL, + 'verb' => Activity::POST, + 'uid' => $user['uid'], + 'cid' => $msg['contact-id'], + 'link' => DI::baseUrl() . '/message/' . $msg['id'], ]; notification($notif_params); @@ -129,9 +122,12 @@ class Mail } $me = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]); - $contact = DBA::selectFirst('contact', [], ['id' => $recipient, 'uid' => local_user()]); + if (!DBA::isResult($me)) { + return -2; + } - if (!(count($me) && (count($contact)))) { + $contact = DBA::selectFirst('contact', [], ['id' => $recipient, 'uid' => local_user()]); + if (!DBA::isResult($contact)) { return -2; }