void TagChangeHelper::start(const Akonadi::Tag &tag, const KMime::Message::Ptr &message, KIMAP::Session *session) { Q_ASSERT(tag.isValid()); const QString mailBox = mTask->mailBoxForCollection(mTask->relationCollection()); const qint64 oldUid = tag.remoteId().toLongLong(); qCDebug(KOLABRESOURCE_LOG) << mailBox << oldUid; const qint64 uidNext = -1; UpdateMessageJob *append = new UpdateMessageJob(message, session, tag.gid(), QSharedPointer<TagMerger>(new TagMerger), mailBox, uidNext, oldUid, this); connect(append, &KJob::result, this, &TagChangeHelper::onReplaceDone); append->setProperty("tag", QVariant::fromValue(tag)); append->start(); }
QByteArray EwsTagStore::serializeTag(const Akonadi::Tag &tag) const { QByteArray tagData; QDataStream stream(&tagData, QIODevice::WriteOnly); stream.setVersion(TagDataVer1StreamVer); stream << TagDataVer1; stream << tag.name() << tag.gid(); Attribute::List attrs = tag.attributes(); stream << (int)attrs.size(); Q_FOREACH(const Attribute *attr, attrs) { stream << attr->type(); stream << attr->serialized(); }