X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=44dcd06c1ce25def421c7f0b765a4bc7bfcf0521;hb=e212eabe53878a8fa6ecb15909a325ed7dd63283;hp=509df19d77671c5b1d45620afcc126122dd7cfe6;hpb=7d30b18136eecbdf2089e5d5877c7e41c6f4bcb6;p=quassel.git diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index 509df19d..44dcd06c 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -101,6 +101,15 @@ public: inline quint16 localPort() const { return socket.localPort(); } inline quint16 peerPort() const { return socket.peerPort(); } + /** + * Gets whether or not a disconnect was expected. + * + * Distinguishes desired quits from unexpected disconnections such as socket errors or timeouts. + * + * @return True if disconnect was requested, otherwise false. + */ + inline bool disconnectExpected() const { return _disconnectExpected; } + QList> splitMessage(const QString &cmd, const QString &message, std::function(QString &)> cmdGenerator); // IRCv3 capability negotiation @@ -284,8 +293,14 @@ public slots: * @see Network::messageRateBurstSize() * @see Network::messageRateDelay() * @see Network::unlimitedMessageRate() + * + * @param[in] forceUnlimited + * @parmblock + * If true, override user settings to disable message rate limiting, otherwise apply rate limits + * set by the user. Use with caution and remember to re-enable configured limits when done. + * @endparmblock */ - void updateRateLimiting(); + void updateRateLimiting(const bool forceUnlimited = false); /** * Resets the token bucket up to the maximum @@ -374,8 +389,8 @@ signals: void sslErrors(const QVariant &errorData); void newEvent(Event *event); - void socketInitialized(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); - void socketDisconnected(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); + void socketInitialized(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort, qint64 socketId); + void socketDisconnected(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort, qint64 socketId); protected: inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); } @@ -438,6 +453,7 @@ private: #else QTcpSocket socket; #endif + qint64 _socketId{0}; CoreUserInputHandler *_userInputHandler; @@ -462,7 +478,7 @@ private: int _lastUsedServerIndex; QTimer _pingTimer; - uint _lastPingTime; + qint64 _lastPingTime; uint _pingCount; bool _sendPings;