Commit bbca2929 authored by mnosovharman's avatar mnosovharman

[messagingframework] QMailStorageAction::onlineMoveFolder implementation. Contributes to JB#41524

Additional fix for ImapClient::mailboxListed: avoid empty folder creations on following IMAP response
* LIST (\Noselect) "/" "/"

Additional fix for 'rename folder': when renaming top level folder - ancestor folder paths were not updated

Additional fix for IMAP (setFolderFlags): for Spam folder, check attributes "\\Spam"
 and "\\Junk" (see rfc6154, Section 2)

Additional fix for IMAP: in case of failure create/delete/rename/move - still need to decrease internal _inProgress counters. Otherwise, after failure - next actions will not ever be completed

Addition for IMAP: don't allow create/rename when name contains IMAP delimiter (e.g. '/')

Additional fix for IMAP: encode folder name on create/rename according to RFC 3501, section 5.1.3.

Additional fix for ImapProtocol::quoteString: fix crash when folder name contains lots of '\\\\\'

Additional fix for 'mailboxListed' - IMAP responses shall be 'unescaped' (in opposite to ImapProtocol::quoteString usage in IMAP requests)
parent 16e178bf
......@@ -73,7 +73,8 @@ enum QMailServerRequestType
SearchMessagesRequestType,
CancelSearchRequestType,
ListActionsRequestType,
ProtocolRequestRequestType
ProtocolRequestRequestType,
MoveFolderRequestType
};
typedef quint64 QMailActionId;
......
......@@ -100,6 +100,7 @@ signals:
void onlineCreateFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
void onlineRenameFolder(quint64, const QMailFolderId &folderId, const QString &name);
void onlineDeleteFolder(quint64, const QMailFolderId &folderId);
void onlineMoveFolder(quint64, const QMailFolderId &folderId, const QMailFolderId &newParentId);
void cancelTransfer(quint64);
......@@ -188,6 +189,8 @@ QMailMessageServerPrivate::QMailMessageServerPrivate(QMailMessageServer* parent)
adaptor, MESSAGE(onlineRenameFolder(quint64, QMailFolderId, QString)));
connectIpc(this, SIGNAL(onlineDeleteFolder(quint64, QMailFolderId)),
adaptor, MESSAGE(onlineDeleteFolder(quint64, QMailFolderId)));
connectIpc(this, SIGNAL(onlineMoveFolder(quint64, QMailFolderId, QMailFolderId)),
adaptor, MESSAGE(onlineMoveFolder(quint64, QMailFolderId, QMailFolderId)));
connectIpc(this, SIGNAL(deleteMessages(quint64, QMailMessageIdList)),
adaptor, MESSAGE(deleteMessages(quint64, QMailMessageIdList)));
connectIpc(this, SIGNAL(rollBackUpdates(quint64, QMailAccountId)),
......@@ -244,6 +247,8 @@ QMailMessageServerPrivate::QMailMessageServerPrivate(QMailMessageServer* parent)
parent, SIGNAL(folderRenamed(quint64, QMailFolderId)));
connectIpc(adaptor, MESSAGE(folderDeleted(quint64, QMailFolderId)),
parent, SIGNAL(folderDeleted(quint64, QMailFolderId)));
connectIpc(adaptor, MESSAGE(folderMoved(quint64, QMailFolderId)),
parent, SIGNAL(folderMoved(quint64, QMailFolderId)));
connectIpc(adaptor, MESSAGE(storageActionCompleted(quint64)),
parent, SIGNAL(storageActionCompleted(quint64)));
connectIpc(adaptor, MESSAGE(retrievalCompleted(quint64)),
......@@ -457,6 +462,15 @@ QMailMessageServerPrivate::~QMailMessageServerPrivate()
\sa onlineDeleteFolder()
*/
/*!
\fn void QMailMessageServer::folderMoved(quint64 action, const QMailFolderId& folderId);
Emitted when the folder identified by \a folderId has been moved, in response to the request
identified by \a action.
\sa onlineMoveFolder()
*/
/*!
\fn void QMailMessageServer::storageActionCompleted(quint64 action);
......@@ -943,7 +957,7 @@ void QMailMessageServer::onlineCreateFolder(quint64 action, const QString &name,
This function requires the device to be online, it may initiate communication
with external servers.
\sa onlineCreateFolder()
\sa onlineCreateFolder(), onlineMoveFolder()
*/
void QMailMessageServer::onlineRenameFolder(quint64 action, const QMailFolderId &folderId, const QString &name)
{
......@@ -959,13 +973,30 @@ void QMailMessageServer::onlineRenameFolder(quint64 action, const QMailFolderId
This function requires the device to be online, it may initiate communication
with external servers.
\sa onlineCreateFolder(), onlineRenameFolder()
\sa onlineCreateFolder(), onlineRenameFolder(), onlineMoveFolder()
*/
void QMailMessageServer::onlineDeleteFolder(quint64 action, const QMailFolderId &folderId)
{
emit d->onlineDeleteFolder(action, folderId);
}
/*!
Requests that the MessageServer move the folder identified by \a folderId.
If \a parentId is a valid folder identifier the new folder will be a child of the parent;
otherwise the folder will be have no parent and will be created at the highest level.
The request has the identifier \a action.
This function requires the device to be online, it may initiate communication
with external servers.
\sa onlineCreateFolder(), onlineRenameFolder()
*/
void QMailMessageServer::onlineMoveFolder(quint64 action, const QMailFolderId &folderId, const QMailFolderId &newParentId)
{
emit d->onlineMoveFolder(action, folderId, newParentId);
}
/*!
Requests that the MessageServer cancel any pending transfer operations for the request identified by \a action.
......
......@@ -97,6 +97,7 @@ signals:
void folderCreated(quint64, const QMailFolderId&);
void folderRenamed(quint64, const QMailFolderId&);
void folderDeleted(quint64, const QMailFolderId&);
void folderMoved(quint64, const QMailFolderId&);
void storageActionCompleted(quint64);
......@@ -148,6 +149,7 @@ public slots:
void onlineCreateFolder(quint64, const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
void onlineRenameFolder(quint64, const QMailFolderId &folderId, const QString &name);
void onlineDeleteFolder(quint64, const QMailFolderId &folderId);
void onlineMoveFolder(quint64, const QMailFolderId &folderId, const QMailFolderId &newParentId);
void deleteMessages(quint64, const QMailMessageIdList &ids);
void rollBackUpdates(quint64, const QMailAccountId &mailAccountId);
......
......@@ -1689,6 +1689,12 @@ void QMailStorageActionPrivate::onlineDeleteFolder(const QMailFolderId &folderId
onlineDeleteFolderHelper(folderId);
}
void QMailStorageActionPrivate::onlineMoveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId)
{
_server->onlineMoveFolder(newAction(), folderId, newParentId);
emitChanges();
}
void QMailStorageActionPrivate::init()
{
QMailServiceActionPrivate::init();
......@@ -2026,6 +2032,20 @@ void QMailStorageAction::onlineDeleteFolder(const QMailFolderId &folderId)
impl(this)->onlineDeleteFolder(folderId);
}
/*!
Requests that the message server move the folder identified by \a folderId.
If \a newParentId is a valid folder identifier the folder will be a child of the parent;
otherwise the folder will be have no parent and will be created at the highest level.
This function requires the device to be online, it may initiate communication with external servers.
\sa onlineCreateFolder(), onlineRenameFolder()
*/
void QMailStorageAction::onlineMoveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId)
{
impl(this)->onlineMoveFolder(folderId, newParentId);
}
QMailSearchActionPrivate::QMailSearchActionPrivate(QMailSearchAction *i)
: QMailServiceActionPrivate(this, i)
......
......@@ -254,6 +254,7 @@ public slots:
void onlineCreateFolder(const QString &name, const QMailAccountId &accountId, const QMailFolderId &parentId);
void onlineRenameFolder(const QMailFolderId &folderId, const QString &name);
void onlineDeleteFolder(const QMailFolderId &folderId);
void onlineMoveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId);
void deleteMessages(const QMailMessageIdList &ids);
void rollBackUpdates(const QMailAccountId &mailAccountId);
......
......@@ -278,6 +278,7 @@ public:
void onlineRenameFolder(const QMailFolderId &id, const QString &name);
void onlineDeleteFolder(const QMailFolderId &id);
void onlineDeleteFolderHelper(const QMailFolderId &id);
void onlineMoveFolder(const QMailFolderId &id, const QMailFolderId &newParentId);
protected:
virtual void init();
......
......@@ -871,7 +871,24 @@ bool QMailMessageSource::deleteFolder(const QMailFolderId &folderId)
return false;
}
/*!
Invoked by the message server to move a folder.
Moves the folder identified by \a folderId to a folder idnetified by \a newParentId.
The name of the folder should not change.
Return true if an operation is initiated.
\sa deleteFolder(), createFolder(), renameFolder()
*/
bool QMailMessageSource::moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId)
{
Q_UNUSED(folderId)
Q_UNUSED(newParentId)
notImplemented();
return false;
}
/*!
Invoked by the message server to initiate a remote message search operation.
......@@ -1923,6 +1940,23 @@ bool QMailMessageSource::deleteFolder(const QMailFolderId &folderId, quint64 act
return false;
}
/*!
\overload moveFolder()
Concurrent version of moveFolder().
The request has the identifier \a action.
*/
bool QMailMessageSource::moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId, quint64 action)
{
Q_UNUSED(folderId)
Q_UNUSED(newParentId)
Q_UNUSED(action)
notImplemented(action);
return false;
}
/*!
\overload searchMessages()
......
......@@ -172,6 +172,8 @@ public slots:
virtual bool renameFolder(const QMailFolderId &folderId, const QString &name, quint64 action);
virtual bool deleteFolder(const QMailFolderId &folderId);
virtual bool deleteFolder(const QMailFolderId &folderId, quint64 action);
virtual bool moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId);
virtual bool moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId, quint64 action);
virtual bool searchMessages(const QMailMessageKey &filter, const QString& bodyText, quint64 limit, const QMailMessageSortKey &sort);
virtual bool searchMessages(const QMailMessageKey &filter, const QString& bodyText, quint64 limit, const QMailMessageSortKey &sort, quint64 action);
......
......@@ -53,7 +53,8 @@ HEADERS += imapclient.h \
imapstrategy.h \
integerregion.h \
imaptransport.h \
serviceactionqueue.h
serviceactionqueue.h \
imapfoldernamecoding.h
SOURCES += imapclient.cpp \
imapconfiguration.cpp \
......@@ -64,7 +65,8 @@ SOURCES += imapclient.cpp \
imapstrategy.cpp \
integerregion.cpp \
imaptransport.cpp \
serviceactionqueue.cpp
serviceactionqueue.cpp \
imapfoldernamecoding.cpp
!contains(DEFINES,QMF_NO_MESSAGE_SERVICE_EDITOR) {
QT += gui
......
......@@ -153,9 +153,10 @@ public slots:
void messageCreated(const QMailMessageId &, const QString &);
void downloadSize(const QString &uid, int);
void urlAuthorized(const QString &url);
void folderDeleted(const QMailFolder &folder);
void folderCreated(const QString &folder);
void folderRenamed(const QMailFolder &folder, const QString &newName);
void folderDeleted(const QMailFolder &folder, bool success);
void folderCreated(const QString &folder, bool success);
void folderRenamed(const QMailFolder &folder, const QString &newName, bool success);
void folderMoved(const QMailFolder &folder, const QString &newName, const QMailFolderId &newParentId, bool success);
protected slots:
void connectionInactive();
......
#include "imapfoldernamecoding.h"
#include <qstring.h>
#include <qlist.h>
QString encodeModifiedBase64(QString in)
{
// Modified Base64 chars pattern
const QString encodingSchema = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
QString result;
QList<ushort> buf;
unsigned short tmp;
int i;
// chars to numeric
for(i = 0; i < in.length(); i++){
buf.push_back(in[i].unicode());
}
// adding &
result.push_back('&');
i = 0;
// encode every 6 bits separately in pattern by 3 symbols
while(i < buf.length()){
result.push_back(encodingSchema[(buf[i] & 0xfc00) >> 10]);
result.push_back(encodingSchema[(buf[i] & 0x3f0) >> 4]);
tmp = 0;
tmp |= ((buf[i] & 0xf) << 12);
if (i + 1 < buf.length())
{
i++;
tmp |= ((buf[i] & 0xc000) >> 4);
result.push_back(encodingSchema[tmp >> 10]);
} else {
result.push_back(encodingSchema[tmp >> 10]);
break;
}
result.push_back(encodingSchema[(buf[i] & 0x3f00) >> 8]);
result.push_back(encodingSchema[(buf[i] & 0xfc) >> 2]);
tmp = 0;
tmp |= ((buf[i] & 0x3) << 14);
if (i + 1 < buf.length())
{
i++;
tmp |= ((buf[i] & 0xf000) >> 2);
result.push_back(encodingSchema[tmp >> 10]);
} else {
result.push_back(encodingSchema[tmp >> 10]);
break;
}
result.push_back(encodingSchema[(buf[i] & 0xfc0) >> 6]);
result.push_back(encodingSchema[buf[i] & 0x3f]);
i++;
}
// adding -
result.push_back('-');
return result;
}
QString encodeModUTF7(QString in)
{
int startIndex = 0;
int endIndex = 0;
while (startIndex < in.length())
{
// insert '_' after '&'
if (in[startIndex] == '&')
{
startIndex++;
in.insert(startIndex, '-');
continue;
}
if (in[startIndex].unicode() < 0x20 || in[startIndex].unicode() > 0x7e)
{
// get non-US-ASCII part
endIndex = startIndex;
while(endIndex < in.length() && (in[endIndex].unicode() < 0x20 || in[endIndex].unicode() > 0x7e))
endIndex++;
// encode non-US-ASCII part
QString unicodeString = in.mid(startIndex,(endIndex - startIndex));
QString mbase64 = encodeModifiedBase64(unicodeString);
// insert the encoded string
in.remove(startIndex,(endIndex-startIndex));
in.insert(startIndex, mbase64);
// set start index to the end of the encoded part
startIndex += mbase64.length() - 1;
}
startIndex++;
}
return in;
}
QString encodeFolderName(const QString &name)
{
return encodeModUTF7(name);
}
QString decodeModifiedBase64(QString in)
{
//remove & -
in.remove(0,1);
in.remove(in.length()-1,1);
if(in.isEmpty())
return "&";
QByteArray buf(in.length(),static_cast<char>(0));
QByteArray out(in.length() * 3 / 4 + 2,static_cast<char>(0));
//chars to numeric
QByteArray latinChars = in.toLatin1();
for (int x = 0; x < in.length(); x++) {
int c = latinChars[x];
if ( c >= 'A' && c <= 'Z')
buf[x] = c - 'A';
if ( c >= 'a' && c <= 'z')
buf[x] = c - 'a' + 26;
if ( c >= '0' && c <= '9')
buf[x] = c - '0' + 52;
if ( c == '+')
buf[x] = 62;
if ( c == ',')
buf[x] = 63;
}
int i = 0; //in buffer index
int j = i; //out buffer index
unsigned char z;
QString result;
while(i+1 < buf.size())
{
out[j] = buf[i] & (0x3F); //mask out top 2 bits
out[j] = out[j] << 2;
z = buf[i+1] >> 4;
out[j] = (out[j] | z); //first byte retrieved
i++;
j++;
if(i+1 >= buf.size())
break;
out[j] = buf[i] & (0x0F); //mask out top 4 bits
out[j] = out[j] << 4;
z = buf[i+1] >> 2;
z &= 0x0F;
out[j] = (out[j] | z); //second byte retrieved
i++;
j++;
if(i+1 >= buf.size())
break;
out[j] = buf[i] & 0x03; //mask out top 6 bits
out[j] = out[j] << 6;
z = buf[i+1];
out[j] = out[j] | z; //third byte retrieved
i+=2; //next byte
j++;
}
//go through the buffer and extract 16 bit unicode network byte order
for(int z = 0; z < out.count(); z+=2) {
unsigned short outcode = 0x0000;
outcode = out[z];
outcode <<= 8;
outcode &= 0xFF00;
unsigned short b = 0x0000;
b = out[z+1];
b &= 0x00FF;
outcode = outcode | b;
if(outcode)
result += QChar(outcode);
}
return result;
}
QString decodeModUTF7(QString in)
{
QRegExp reg("&[^&-]*-");
int startIndex = 0;
int endIndex = 0;
startIndex = in.indexOf(reg,endIndex);
while (startIndex != -1) {
endIndex = startIndex;
while(endIndex < in.length() && in[endIndex] != '-')
endIndex++;
endIndex++;
//extract the base64 string from the input string
QString mbase64 = in.mid(startIndex,(endIndex - startIndex));
QString unicodeString = decodeModifiedBase64(mbase64);
//remove encoding
in.remove(startIndex,(endIndex-startIndex));
in.insert(startIndex,unicodeString);
endIndex = startIndex + unicodeString.length();
startIndex = in.indexOf(reg,endIndex);
}
return in;
}
QString decodeFolderName(const QString &name)
{
return decodeModUTF7(name);
}
/****************************************************************************
**
** Copyright (C) 2018 TBD
** Contact: TBD
**
** This file is part of the Qt Messaging Framework.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef IMAPFOLDERNAMECODING_H
#define IMAPFOLDERNAMECODING_H
#include <qstring.h>
QString encodeFolderName(const QString &name);
QString decodeFolderName(const QString &name);
#endif
......@@ -91,7 +91,8 @@ enum ImapCommand
IMAP_QResync,
IMAP_FetchFlags,
IMAP_Noop,
IMAP_Compress
IMAP_Compress,
IMAP_Move
};
enum MessageFlag
......@@ -199,6 +200,7 @@ public:
void sendCreate(const QMailFolderId &parentFolderId, const QString &name);
void sendDelete(const QMailFolder &mailbox);
void sendRename(const QMailFolder &mailbox, const QString &newname);
void sendMove(const QMailFolder &mailbox, const QMailFolderId &newParentId);
/* Valid in Selected state only */
void sendSearchMessages(const QMailMessageKey &key, const QString &body, const QMailMessageSortKey &sort, bool count);
......@@ -226,6 +228,7 @@ public:
static QString quoteString(const QString& input);
static QByteArray quoteString(const QByteArray& input);
static QString unescapeFolderPath(const QString &path);
signals:
void mailboxListed(const QString &flags, const QString &name);
......@@ -238,9 +241,10 @@ signals:
void messageCreated(const QMailMessageId& id, const QString& uid);
void urlAuthorized(const QString& url);
void folderCreated(const QString &folder);
void folderDeleted(const QMailFolder &name);
void folderRenamed(const QMailFolder &folder, const QString &newPath);
void folderCreated(const QString &folder, bool success);
void folderDeleted(const QMailFolder &name, bool success);
void folderRenamed(const QMailFolder &folder, const QString &newPath, bool success);
void folderMoved(const QMailFolder &folder, const QString &newPath, const QMailFolderId &newParentId, bool success);
void continuationRequired(ImapCommand, const QString &);
void completed(ImapCommand, OperationStatus);
......
......@@ -176,6 +176,7 @@ public slots:
virtual bool createStandardFolders(const QMailAccountId &accountId);
virtual bool deleteFolder(const QMailFolderId &folderId);
virtual bool renameFolder(const QMailFolderId &folderId, const QString &name);
virtual bool moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId);
virtual bool searchMessages(const QMailMessageKey &searchCriteria, const QString &bodyText, const QMailMessageSortKey &sort);
virtual bool searchMessages(const QMailMessageKey &searchCriteria, const QString &bodyText, quint64 limit, const QMailMessageSortKey &sort);
......@@ -1169,6 +1170,32 @@ bool ImapService::Source::renameFolder(const QMailFolderId &folderId, const QStr
return true;
}
bool ImapService::Source::moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId)
{
Q_ASSERT(!_unavailable);
if (!_service)
return false;
if (!_service->_client) {
_service->errorOccurred(QMailServiceAction::Status::ErrFrameworkFault, tr("Account disabled"));
return false;
}
if(!folderId.isValid()) {
_service->errorOccurred(QMailServiceAction::Status::ErrInvalidData, tr("Cannot move an invalid folder"));
return false;
}
_service->_client->strategyContext()->moveFolderStrategy.moveFolder(folderId, newParentId);
appendStrategy(&_service->_client->strategyContext()->moveFolderStrategy);
if(!_unavailable)
return initiateStrategy();
return true;
}
bool ImapService::Source::searchMessages(const QMailMessageKey &searchCriteria, const QString &bodyText, const QMailMessageSortKey &sort)
{
QMailAccountConfiguration accountCfg(_service->accountId());
......
......@@ -149,9 +149,10 @@ public:
virtual void messageCreated(ImapStrategyContextBase *context, const QMailMessageId &id, const QString &uid);
virtual void downloadSize(ImapStrategyContextBase *context, const QString &uid, int length);
virtual void urlAuthorized(ImapStrategyContextBase *context, const QString &url);
virtual void folderCreated(ImapStrategyContextBase *context, const QString &folder);
virtual void folderDeleted(ImapStrategyContextBase *context, const QMailFolder &folder);
virtual void folderRenamed(ImapStrategyContextBase *context, const QMailFolder &folder, const QString &newName);
virtual void folderCreated(ImapStrategyContextBase *context, const QString &folder, bool success);
virtual void folderDeleted(ImapStrategyContextBase *context, const QMailFolder &folder, bool success);
virtual void folderRenamed(ImapStrategyContextBase *context, const QMailFolder &folder, const QString &newName, bool success);
virtual void folderMoved(ImapStrategyContextBase *context, const QMailFolder &folder, const QString &newName, const QMailFolderId &newParentId, bool success);
virtual void selectFolder(ImapStrategyContextBase *context, const QMailFolder &folder);
void clearError() { _error = false; }
......@@ -177,7 +178,7 @@ public:
virtual void transition(ImapStrategyContextBase *, const ImapCommand, const OperationStatus);
virtual void createFolder(const QMailFolderId &folder, const QString &name, bool matchFoldersRequired);
virtual void folderCreated(ImapStrategyContextBase *context, const QString &folder);
virtual void folderCreated(ImapStrategyContextBase *context, const QString &folder, bool success);
protected:
virtual void handleCreate(ImapStrategyContextBase *context);
virtual void handleLogin(ImapStrategyContextBase *context);
......@@ -199,7 +200,7 @@ public:
virtual void transition(ImapStrategyContextBase *, const ImapCommand, const OperationStatus);
virtual void deleteFolder(const QMailFolderId &folderId);
virtual void folderDeleted(ImapStrategyContextBase *context, const QMailFolder &folder);
virtual void folderDeleted(ImapStrategyContextBase *context, const QMailFolder &folder, bool success);
protected:
virtual void handleLogin(ImapStrategyContextBase *context);
virtual void handleDelete(ImapStrategyContextBase *context);
......@@ -217,7 +218,8 @@ public:
virtual void transition(ImapStrategyContextBase *, const ImapCommand, const OperationStatus);
virtual void renameFolder(const QMailFolderId &folderId, const QString &newName);
virtual void folderRenamed(ImapStrategyContextBase *context, const QMailFolder &folder, const QString &name);
virtual void folderRenamed(ImapStrategyContextBase *context, const QMailFolder &folder,
const QString &name, bool success);
protected:
virtual void handleLogin(ImapStrategyContextBase *context);
virtual void handleRename(ImapStrategyContextBase *context);
......@@ -226,6 +228,24 @@ protected:
int _inProgress;
};
class ImapMoveFolderStrategy : public ImapStrategy
{
public:
ImapMoveFolderStrategy() : _inProgress(0) { }
virtual ~ImapMoveFolderStrategy() {}
virtual void transition(ImapStrategyContextBase *, const ImapCommand, const OperationStatus);
virtual void moveFolder(const QMailFolderId &folderId, const QMailFolderId &newParentId);
virtual void folderMoved(ImapStrategyContextBase *context, const QMailFolder &folder,
const QString &newPath, const QMailFolderId &newParentId, bool success);
protected:
virtual void handleLogin(ImapStrategyContextBase *context);