]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Add tests for the PermissionSet repository
[friendica.git] / mod / message.php
index dff0531032171f46535739bfb42a4114246dd137..1c6502ee1593fe36822a0bbb4ea5075e4df13f40 100644 (file)
@@ -212,14 +212,7 @@ function message_content(App $a)
 
                $o .= $header;
 
-               $total = 0;
-               $r = DBA::fetchFirst("SELECT count(*) AS `total`, ANY_VALUE(`created`) AS `created` FROM `mail`
-                       WHERE `mail`.`uid` = ? GROUP BY `parent-uri` ORDER BY `created` DESC",
-                       local_user()
-               );
-               if (DBA::isResult($r)) {
-                       $total = $r['total'];
-               }
+               $total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']);
 
                $pager = new Pager(DI::l10n(), DI::args()->getQueryString());