X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FEmail.php;h=db22b76973b736ef86f9ecb6a591aca081771c07;hb=aacaa3c2cf7ac4189ae6b41701d66ee3cd7f8535;hp=06946d4830795d9987d237ff83d19ef7f7a38cad;hpb=2c56d2f3360c08e312e5c167261af8e5d4b87af4;p=friendica.git diff --git a/src/Protocol/Email.php b/src/Protocol/Email.php index 06946d4830..db22b76973 100644 --- a/src/Protocol/Email.php +++ b/src/Protocol/Email.php @@ -1,6 +1,6 @@ $errors]); } $alerts = imap_alerts(); if (!empty($alerts)) { - Logger::log('IMAP Alerts occured: ' . json_encode($alerts)); + Logger::notice('IMAP Alerts occured: ', ['alerts' => $alerts]); } return $mbox; } /** - * @param resource $mbox mailbox - * @param string $email_addr email + * @param Connection|resource $mbox mailbox + * @param string $email_addr email * @return array * @throws \Exception */ - public static function poll($mbox, $email_addr) + public static function poll($mbox, $email_addr): array { if (!$mbox || !$email_addr) { return []; @@ -77,21 +78,21 @@ class Email if (!$search1) { $search1 = []; } else { - Logger::log("Found mails from ".$email_addr, Logger::DEBUG); + Logger::notice("Found mails from ".$email_addr); } $search2 = @imap_search($mbox, 'UNDELETED TO "' . $email_addr . '"', SE_UID); if (!$search2) { $search2 = []; } else { - Logger::log("Found mails to ".$email_addr, Logger::DEBUG); + Logger::notice("Found mails to ".$email_addr); } $search3 = @imap_search($mbox, 'UNDELETED CC "' . $email_addr . '"', SE_UID); if (!$search3) { $search3 = []; } else { - Logger::log("Found mails cc ".$email_addr, Logger::DEBUG); + Logger::notice("Found mails cc ".$email_addr); } $res = array_unique(array_merge($search1, $search2, $search3)); @@ -112,8 +113,8 @@ class Email } /** - * @param resource $mbox mailbox - * @param integer $uid user id + * @param Connection|resource $mbox mailbox + * @param integer $uid user id * @return mixed */ public static function messageMeta($mbox, $uid) @@ -123,13 +124,13 @@ class Email } /** - * @param resource $mbox mailbox - * @param integer $uid user id - * @param string $reply reply + * @param Connection|resource $mbox mailbox + * @param integer $uid user id + * @param string $reply reply * @return array * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function getMessage($mbox, $uid, $reply, $item) + public static function getMessage($mbox, $uid, $reply, $item): array { $ret = $item; @@ -210,11 +211,11 @@ class Email /** * fetch the specified message part number with the specified subtype * - * @param resource $mbox mailbox - * @param integer $uid user id - * @param object $p parts - * @param integer $partno part number - * @param string $subtype sub type + * @param Connection|resource $mbox mailbox + * @param integer $uid user id + * @param object $p parts + * @param integer $partno part number + * @param string $subtype sub type * @return string */ private static function messageGetPart($mbox, $uid, $p, $partno, $subtype) @@ -396,7 +397,7 @@ class Email //$message = '' . $html . ''; //$message = html2plain($html); - Logger::log('notifier: email delivery to ' . $addr); + Logger::notice('notifier: email delivery to ' . $addr); mail($addr, $subject, $body, $headers); }