X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FMail.php;h=2670a5885f2d8ef57dde74d9fcc0dd723b0ab020;hb=b3f71d174c2f64d4bb527a6343cc4ba88f410a42;hp=405635215197f48de88b6a9473c8c802908922e2;hpb=77e0d8c7bcb698b8c8f5f5acfa01088d2395d216;p=friendica.git diff --git a/src/Model/Mail.php b/src/Model/Mail.php index 4056352151..2670a5885f 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -27,7 +27,6 @@ use Friendica\Core\Worker; use Friendica\DI; use Friendica\Database\DBA; use Friendica\Model\Notify\Type; -use Friendica\Network\Probe; use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; use Friendica\Worker\Delivery; @@ -85,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); @@ -130,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; } @@ -267,7 +262,7 @@ class Mail $guid = System::createUUID(); $uri = Item::newURI(local_user(), $guid); - $me = Probe::uri($replyto); + $me = Contact::getByURL($replyto); if (!$me['name']) { return -2; }