@param Model $recipient

@return bool
188542
public function hasBlocked(Model $recipient)
    {
        return $this->friends()->whereRecipient($recipient)->whereStatus(Status::BLOCKED)->exists();
    }
1268649
public function addRecipient(Recipient $recipient)
    {
        if (!$recipient instanceof Device && !$recipient instanceof Topic) {
            throw new \UnexpectedValueException('currently phpFCM only supports topic and single device messages');
        }

        if (!isset($this->recipientType)) {
            $this->recipientType = get_class($recipient);
        }

        if ($this->recipientType !== get_class($recipient)) {
            throw new \InvalidArgumentException('mixed recepient types are not supported by FCM');
        }

        $this->recipients[] = $recipient;
        return $this;
    }
1366314
public function hasFollowRequestFrom(Model $sender)
    {
        return $this->whenFollowedBy($sender)->whereStatus(Status::PENDING)->exists();
    }
72915
public function addRecipient($recipient)
    {
        if (is_string($recipient)) {
            $recipient = new Recipient($recipient);
        } elseif (!$recipient instanceof Recipient) {
            throw new \InvalidArgumentException('$recipient must be a string or an instance of Recipient.');
        }

        $this->recipients[] = $recipient;

        return $this;
    }
809963
public static function recipient($recipient) {
    if (is_string($recipient)) return $recipient;
    if (is_array($recipient)) return $recipient; // @TODO checks?
    
    throw new Exception('Unbekannter Parameter: '.Code::varInfo($recipient));
  }
744149
public function send($message, $recipient, $mustInit = true)
    {
        if ($mustInit) $this->_init();

        $params = array(
            'api' => $this->api_key,
            'number' => $recipient,
            'message' => $message,
            'from' => $this->from,
        );

        $query = http_build_query($params);

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, Config::get('semaphore::url.sms.sms'));
        curl_setopt($ch, CURLOPT_POST, count($params));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        curl_close($ch);

        return $response;
    }
658
public function decryptUsingKey(JWE &$jwe, JWK $jwk, int $recipient): bool
    {
        $jwkset = new JWKSet([$jwk]);

        return $this->decryptUsingKeySet($jwe, $jwkset, $recipient);
    }
450140
public function isFollowing(Model $recipient)
    {
        return $this->whenFollowing($recipient)->where('status', Status::ACCEPTED)->exists();
    }
386531
public function addRecipient($recipient)
    {
        if (!is_string($recipient)) {
            throw new \Exception('Recipient is not string.');
        }

        try {
            $new = new EmailUser;
            $new->email = $recipient;

            $this->addRecipientUser($new);
        } catch (\Exception $e) {
            return false;
        }

        return true;
    }
1211523
private function checkMessageResult($message, \ArrayIterator $recipients)
    {
        $hasDeviceError = false;

        $recipientCount = $recipients->count();

        for ($i = 0; $i <= $recipientCount; $i++) {
            if (isset($message->results[$i]['registration_id'])) {
                $hasDeviceError = true;
                $recipients->offsetGet($i)->setIdentifierToReplaceTo($message->results[$i]['registration_id']);
            }

            if (isset($message->results[$i]['error'])) {
                $hasDeviceError = true;
                $error = $message->results[$i]['error'];
                $this->processError($error, $recipients->offsetGet($i));
            }
        }

        if ($hasDeviceError) {
            throw new InvalidRecipientException("Device identifier error status", $recipients);
        }
    }
531218
public function hasPermission($recipient, $permission)
    {

        if ($recipient instanceof Group) {
            $check = true;
            foreach ($recipient->getLogins() as $login) {
                if ($this->hasLoginPermission($login, $permission) === false) {
                    $check = false;
                }
            }

            return $check;
        } else {
            return $this->hasLoginPermission($recipient, $permission);
        }
    }
726297
public function createMessage($recipient, $subject, $body)
    {
        $recipients = explode(',', trim($recipient));

        return \Swift_Message::newInstance()
            ->setSender($this->sender)
            ->setFrom($this->sender)
            ->setTo($recipients)
            ->setSubject($subject)
            ->setBody($body, 'text/html');
    }
720973
public function notificationSubject($comment, $recipient)
    {
        $subject = $this->owner->config()->default_notification_subject;

        $this->owner->invokeWithExtensions('updateNotificationSubject', $subject, $comment, $recipient);

        return $subject;
    }
1185419
public function fire($recipient, $message)
    {
        // because we cant use "$message" on Laravel emails
        $msg = $message;

        try {
            Mail::send('eyewitness::email.notification', ['recipient' => $recipient, 'msg' => $msg], function ($m) use ($recipient, $msg) {
                $m->to($recipient->address);
                $m->subject($msg->title());
            });
        } catch (Exception $e) {
            app(Eye::class)->logger()->error('Unable to send Email noitification', $e);
        }
    }
404674
public function unblockFriendRequest(Model $recipient): bool
    {
        if (!$this->isFriendsWith($recipient)) {
            return false;
        }

        return (bool) $this->findFriendship($recipient)->update([
            'status' => Status::PENDING,
        ]);
    }
726168
private function getChannels(MessageInterface $message, RecipientInterface $recipient)
    {
        $channels = $this->channelResolver
            ->getChannels($message->getType(), $this->getChannelStore());

        return $this->channelResolver
            ->filterChannels($recipient, $message->getType(), $channels);
    }
1028721
public function validateSender($sender)
    {
        if (is_null($sender)) {
            $this->addError('sender', 'Sender is null');
            return false;
        }

        if (false === filter_var(key($sender), FILTER_VALIDATE_EMAIL)) {
            $this->addError('sender', sprintf('Sender recipient `%s` must be a valid email address', key($sender)));

            return false;
        }

        return true;
    }