Akonadi

tagfetchhandler.cpp
1/***************************************************************************
2 * SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com> *
3 * *
4 * SPDX-License-Identifier: LGPL-2.0-or-later *
5 ***************************************************************************/
6
7#include "tagfetchhandler.h"
8#include "connection.h"
9#include "tagfetchhelper.h"
10
11using namespace Akonadi;
12using namespace Akonadi::Server;
13
14TagFetchHandler::TagFetchHandler(AkonadiServer &akonadi)
15 : Handler(akonadi)
16{
17}
18
20{
21 const auto &cmd = Protocol::cmdCast<Protocol::FetchTagsCommand>(m_command);
22
23 if (!checkScopeConstraints(cmd.scope(), {Scope::Invalid, Scope::Uid})) {
24 return failureResponse("Only full-range or UID-based TAGFETCH is supported");
25 }
26
27 TagFetchHelper helper(connection(), cmd.scope(), cmd.fetchScope());
28 if (!helper.fetchTags()) {
29 return failureResponse("Failed to fetch tags");
30 }
31
32 return successResponse<Protocol::FetchTagsResponse>();
33}
The handler interfaces describes an entity capable of handling an AkonadiIMAP command.
Definition handler.h:32
bool parseStream() override
Parse and handle the IMAP message using the streaming parser.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.