]> git.mxchange.org Git - friendica.git/commitdiff
Fix warning concerning a missing "created" field
authorMichael <heluecht@pirati.ca>
Sun, 14 Jan 2024 11:58:06 +0000 (11:58 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 14 Jan 2024 11:58:06 +0000 (11:58 +0000)
src/Model/Mail.php
src/Model/Photo.php

index 372ec8a4521e2832e1ea0cb4000265638af7fd84..08c703cecc246e6ca19733eda6fcd07e75f5455a 100644 (file)
@@ -127,8 +127,6 @@ class Mail
         */
        public static function send(int $sender_uid, int $recipient = 0, string $body = '', string $subject = '', string $replyto = ''): int
        {
-               $a = DI::app();
-
                if (!$recipient) {
                        return -1;
                }
@@ -246,77 +244,4 @@ class Mail
                        return -3;
                }
        }
-
-       /**
-        * @param array  $recipient recipient, default empty
-        * @param string $body      message body, default empty
-        * @param string $subject   message subject, default empty
-        * @param string $replyto   reply to, default empty
-        * @return int
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \ImagickException
-        */
-       public static function sendWall(array $recipient = [], string $body = '', string $subject = '', string $replyto = ''): int
-       {
-               if (!$recipient) {
-                       return -1;
-               }
-
-               if (!strlen($subject)) {
-                       $subject = DI::l10n()->t('[no subject]');
-               }
-
-               $guid = System::createUUID();
-               $uri = Item::newURI($guid);
-
-               $me = Contact::getByURL($replyto);
-               if (!$me['name']) {
-                       return -2;
-               }
-
-               $conv_guid = System::createUUID();
-
-               $recip_handle = $recipient['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
-
-               $sender_handle = $me['addr'];
-
-               $handles = $recip_handle . ';' . $sender_handle;
-
-               $convid = null;
-               $fields = ['uid' => $recipient['uid'], 'guid' => $conv_guid, 'creator' => $sender_handle,
-                       'created' => DateTimeFormat::utcNow(), 'updated' => DateTimeFormat::utcNow(),
-                       'subject' => $subject, 'recips' => $handles];
-               if (DBA::insert('conv', $fields)) {
-                       $convid = DBA::lastInsertId();
-               }
-
-               if (!$convid) {
-                       Logger::warning('conversation not found.');
-                       return -4;
-               }
-
-               self::insert(
-                       [
-                               'uid' => $recipient['uid'],
-                               'guid' => $guid,
-                               'convid' => $convid,
-                               'from-name' => $me['name'],
-                               'from-photo' => $me['photo'],
-                               'from-url' => $me['url'],
-                               'contact-id' => 0,
-                               'title' => $subject,
-                               'body' => $body,
-                               'seen' => 0,
-                               'reply' => 0,
-                               'replied' => 0,
-                               'uri' => $uri,
-                               'parent-uri' => $me['url'],
-                               'created' => DateTimeFormat::utcNow(),
-                               'unknown' => 1
-                       ],
-                       false
-               );
-
-               return 0;
-       }
 }
index d10d70b8eb9066e34bc4b00b447597ea20365943..903c65db3441c2af9cc989ff939b93f15e82f8d7 100644 (file)
@@ -762,7 +762,7 @@ class Photo
                                ));
                        } else {
                                // This query doesn't do the count and is much faster
-                               $albums = DBA::toArray(DBA::p("SELECT DISTINCT(`album`), '' AS `total`
+                               $albums = DBA::toArray(DBA::p("SELECT DISTINCT(`album`), '' AS `total`, ANY_VALUE(`created`) AS `created`
                                        FROM `photo` USE INDEX (`uid_album_scale_created`)
                                        WHERE `uid` = ? AND `photo-type` IN (?, ?, ?) $sql_extra",
                                        $uid,