]> source.dussan.org Git - nextcloud-server.git/commitdiff
ShareByMailProvider: getAccessList: set both array keys 'public' and 'mail'
authorAdam Serbinski <adam@serbinski.com>
Thu, 26 Jan 2023 15:19:54 +0000 (10:19 -0500)
committerAdam Serbinski <37986043+ASerbinski@users.noreply.github.com>
Thu, 21 Mar 2024 22:25:31 +0000 (18:25 -0400)
To preserve prior behaviour where 'public' was set 'true' if there
are any mail recipients. The 'mail' key will be an array of email
recipients.

Signed-off-by: Adam Serbinski <adam@serbinski.com>
apps/sharebymail/lib/ShareByMailProvider.php

index 3704de4309f30596d4a4959ec719a4d127ff376d..e7f1db25a9b8ba6a89d008e10df9700fc57475d2 100644 (file)
@@ -1108,6 +1108,7 @@ class ShareByMailProvider implements IShareProvider {
                        ));
                $cursor = $qb->executeQuery();
 
+               $public = $cursor->rowCount() > 0;
                $mail = [];
                while ($row = $cursor->fetch()) {
                        if ($currentAccess === false) {
@@ -1121,7 +1122,7 @@ class ShareByMailProvider implements IShareProvider {
                }
                $cursor->closeCursor();
 
-               return ['public' => $mail];
+               return ['public' => $public, 'mail' => $mail];
        }
 
        public function getAllShares(): iterable {