private function get_private_reply_sql(stdClass $user, bool $canseeprivatereplies) {
        $params = [];
        $privatewhere = '';
        if (!$canseeprivatereplies) {
            $privatewhere = ' AND (p.privatereplyto = :privatereplyto OR p.userid = :privatereplyfrom OR p.privatereplyto = 0)';
            $params['privatereplyto'] = $user->id;
            $params['privatereplyfrom'] = $user->id;
        }

        return [
            'where' => $privatewhere,
            'params' => $params,
        ];
    }