X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fctcpevent.h;h=dec8ba35b16c7f6c4983dea5e2e825720ec3db2f;hp=f9d7f4375a91ebb02629be80819f0a1611aacfa8;hb=edc55b1f86cf613a332eeeb5d85537a54120dfa5;hpb=3a3e844f9fcfd12235a0086af75ecd503b621ef4 diff --git a/src/common/ctcpevent.h b/src/common/ctcpevent.h index f9d7f437..dec8ba35 100644 --- a/src/common/ctcpevent.h +++ b/src/common/ctcpevent.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,59 +22,67 @@ #include "common-export.h" -#include "ircevent.h" +#include #include -#include + +#include "ircevent.h" class COMMON_EXPORT CtcpEvent : public IrcEvent { public: - enum CtcpType { + enum CtcpType + { Query, Reply }; - explicit CtcpEvent(EventManager::EventType type, Network *network, const QString &prefix, QString target, - CtcpType ctcpType, QString ctcpCmd, QString param, - const QDateTime ×tamp = QDateTime(), const QUuid &uuid = QUuid()) - : IrcEvent(type, network, prefix), - _ctcpType(ctcpType), - _ctcpCmd(std::move(ctcpCmd)), - _target(std::move(target)), - _param(std::move(param)), - _uuid(uuid) + explicit CtcpEvent(EventManager::EventType type, + Network* network, + QHash tags, + QString prefix, + QString target, + CtcpType ctcpType, + QString ctcpCmd, + QString param, + const QDateTime& timestamp = QDateTime(), + const QUuid& uuid = QUuid()) + : IrcEvent(type, network, std::move(tags), std::move(prefix)) + , _ctcpType(ctcpType) + , _ctcpCmd(std::move(ctcpCmd)) + , _target(std::move(target)) + , _param(std::move(param)) + , _uuid(uuid) { setTimestamp(timestamp); } - inline CtcpType ctcpType() const { return _ctcpType; } inline void setCtcpType(CtcpType type) { _ctcpType = type; } inline QString ctcpCmd() const { return _ctcpCmd; } - inline void setCtcpCmd(const QString &ctcpCmd) { _ctcpCmd = ctcpCmd; } + inline void setCtcpCmd(const QString& ctcpCmd) { _ctcpCmd = ctcpCmd; } inline QString target() const { return _target; } - inline void setTarget(const QString &target) { _target = target; } + inline void setTarget(const QString& target) { _target = target; } inline QString param() const { return _param; } - inline void setParam(const QString ¶m) { _param = param; } + inline void setParam(const QString& param) { _param = param; } inline QString reply() const { return _reply; } - inline void setReply(const QString &reply) { _reply = reply; } + inline void setReply(const QString& reply) { _reply = reply; } inline QUuid uuid() const { return _uuid; } - inline void setUuid(const QUuid &uuid) { _uuid = uuid; } + inline void setUuid(const QUuid& uuid) { _uuid = uuid; } - static Event *create(EventManager::EventType type, QVariantMap &map, Network *network); + static Event* create(EventManager::EventType type, QVariantMap& map, Network* network); protected: - explicit CtcpEvent(EventManager::EventType type, QVariantMap &map, Network *network); - void toVariantMap(QVariantMap &map) const override; + explicit CtcpEvent(EventManager::EventType type, QVariantMap& map, Network* network); + void toVariantMap(QVariantMap& map) const override; inline QString className() const override { return "CtcpEvent"; } - inline void debugInfo(QDebug &dbg) const override + inline void debugInfo(QDebug& dbg) const override { NetworkEvent::debugInfo(dbg); dbg << ", prefix = " << qPrintable(prefix()) @@ -85,7 +93,6 @@ protected: << ", reply = " << qPrintable(reply()); } - private: CtcpType _ctcpType; QString _ctcpCmd;