X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=a007de8d84f5037201b9a8a4bc1b6eb0948d2dbc;hb=1d5206d594a76297f36ecbaa85ac1ef46ba57c1d;hp=2f4fe0c1aaf47047110d68b995469e62a534803d;hpb=15b93b4459f051c1cf6d394a597399f17f9748f3;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 2f4fe0c1aa..a007de8d84 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,6 +1,6 @@ redirect('message/' . $conversation['id'] ); } else { - $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval(DI::args()->getArgv()[2]), - intval(local_user()) - ); - if (DBA::isResult($r)) { - $parent = $r[0]['parent-uri']; + $parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]); + if (DBA::isResult($parentmail)) { + $parent = $parentmail['parent-uri']; if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { notice(DI::l10n()->t('Conversation was not removed.')); @@ -215,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());