/***************************************************************************
- * Copyright (C) 2005-2019 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#pragma once
-#include "coreircchannel.h"
-#include "coreircuser.h"
-#include "network.h"
+#include <functional>
-// IRCv3 capabilities
+#include <QSslError>
+#include <QSslSocket>
#include <QTimer>
-#include "irccap.h"
-
-#ifdef HAVE_SSL
-# include <QSslError>
-# include <QSslSocket>
-#else
-# include <QTcpSocket>
-#endif
-
#ifdef HAVE_QCA2
# include "cipher.h"
#endif
-#include <functional>
-
+#include "coreircchannel.h"
+#include "coreircuser.h"
#include "coresession.h"
+#include "irccap.h"
+#include "irctag.h"
+#include "network.h"
class CoreIdentity;
class CoreUserInputHandler;
*
* @returns True if in progress, otherwise false
*/
- inline bool capNegotiationInProgress() const { return (!_capsQueuedIndividual.empty() || !_capsQueuedBundled.empty()); }
+ inline bool capsPendingNegotiation() const { return (!_capsQueuedIndividual.empty() || !_capsQueuedBundled.empty()); }
/**
* Queues a capability to be requested.
* maintain PING/PONG replies, the other side will close the connection.
* @endparmblock
*/
- void putCmd(const QString& cmd, const QList<QByteArray>& params, const QByteArray& prefix = {}, bool prepend = false);
+ void putCmd(const QString& cmd, const QList<QByteArray>& params, const QByteArray& prefix = {}, const QHash<IrcTagKey, QString> &tags = {}, bool prepend = false);
/**
* Sends the command for each set of encoded parameters, with optional prefix or high priority.
* cannot maintain PING/PONG replies, the other side will close the connection.
* @endparmblock
*/
- void putCmd(const QString& cmd, const QList<QList<QByteArray>>& params, const QByteArray& prefix = {}, bool prependAll = false);
+ void putCmd(const QString& cmd, const QList<QList<QByteArray>>& params, const QByteArray& prefix = {}, const QHash<IrcTagKey, QString> &tags = {}, bool prependAll = false);
void setChannelJoined(const QString& channel);
void setChannelParted(const QString& channel);
* set by the user. Use with caution and remember to re-enable configured limits when done.
* @endparmblock
*/
- void updateRateLimiting(const bool forceUnlimited = false);
+ void updateRateLimiting(bool forceUnlimited = false);
/**
* Resets the token bucket up to the maximum
*/
inline void resetPongReplyPending() { _pongReplyPending = false; }
- void onDisplayMsg(Message::Type msgType,
- BufferInfo::Type bufferType,
- const QString& target,
- const QString& text,
- const QString& sender,
- Message::Flags flags)
+ void onDisplayMsg(const NetworkInternalMessage& msg)
{
- emit displayMsg(networkId(), msgType, bufferType, target, text, sender, flags);
+ emit displayMsg(RawMessage(networkId(), msg));
}
signals:
- void recvRawServerMsg(QString);
- void displayStatusMsg(QString);
- void displayMsg(
- NetworkId, Message::Type, BufferInfo::Type, const QString& target, const QString& text, const QString& sender, Message::Flags flags);
+ void recvRawServerMsg(const QString&);
+ void displayStatusMsg(const QString&);
+ void displayMsg(const RawMessage& msg);
void disconnected(NetworkId networkId);
void connectionError(const QString& errorMsg);
void sendAutoWho();
void startAutoWhoCycle();
-#ifdef HAVE_SSL
void onSslErrors(const QList<QSslError>& errors);
-#endif
/**
* Check the message token bucket
void writeToSocket(const QByteArray& data);
private:
- void showMessage(Message::Type msgType,
- BufferInfo::Type bufferType,
- const QString& target,
- const QString& text,
- const QString& sender = "",
- Message::Flags flags = Message::None)
+ void showMessage(const NetworkInternalMessage& msg)
{
- emit displayMsg(networkId(), msgType, bufferType, target, text, sender, flags);
+ emit displayMsg(RawMessage(networkId(), msg));
}
private:
bool _debugLogRawIrc; ///< If true, include raw IRC socket messages in the debug log
qint32 _debugLogRawNetId; ///< Network ID for logging raw IRC socket messages, or -1 for all
-#ifdef HAVE_SSL
QSslSocket socket;
-#else
- QTcpSocket socket;
-#endif
qint64 _socketId{0};
CoreUserInputHandler* _userInputHandler;
+ MetricsServer* _metricsServer;
QHash<QString, QString> _channelKeys; // stores persistent channels and their passwords, if any