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