X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=0f6559a847f2327828a9ae121d19f5ace487f3af;hp=7b458509bc6ddbd1c27a156b174125e611ec6d6e;hb=d0f10fd4b6455fe2d0cf38d7c32e7cd61fc96f1b;hpb=6f0a153a674317d77233139fc50a2985af86e36e diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index 7b458509..0f6559a8 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -41,10 +41,9 @@ #include "coresession.h" class CoreIdentity; -class IrcServerHandler; class CoreUserInputHandler; -class CtcpHandler; class CoreIgnoreListManager; +class Event; class CoreNetwork : public Network { SYNCABLE_OBJECT @@ -59,9 +58,7 @@ public: inline CoreSession *coreSession() const { return _coreSession; } inline CoreNetworkConfig *networkConfig() const { return coreSession()->networkConfig(); } - inline IrcServerHandler *ircServerHandler() const { return _ircServerHandler; } inline CoreUserInputHandler *userInputHandler() const { return _userInputHandler; } - inline CtcpHandler *ctcpHandler() const { return _ctcpHandler; } inline CoreIgnoreListManager *ignoreListManager() { return coreSession()->ignoreListManager(); } //! Decode a string using the server (network) decoding. @@ -88,6 +85,13 @@ public: inline UserId userId() const { return _coreSession->user(); } + inline QAbstractSocket::SocketState socketState() { return socket.state(); } + inline bool socketConnected() { return socket.state() == QAbstractSocket::ConnectedState; } + inline QHostAddress localAddress() { return socket.localAddress(); } + inline QHostAddress peerAddress() { return socket.peerAddress(); } + inline quint16 localPort() { return socket.localPort(); } + inline quint16 peerPort() { return socket.peerPort(); } + public slots: virtual void setMyNick(const QString &mynick); @@ -115,6 +119,7 @@ public slots: // Blowfish stuff #ifdef HAVE_QCA2 + Cipher *cipher(const QString &recipient) const; QByteArray cipherKey(const QString &recipient) const; void setCipherKey(const QString &recipient, const QByteArray &key); #endif @@ -147,6 +152,8 @@ signals: void quitRequested(NetworkId networkId); void sslErrors(const QVariant &errorData); + void newEvent(Event *event); + protected: inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); } inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new CoreIrcUser(hostmask, this); } @@ -192,9 +199,7 @@ private: QTcpSocket socket; #endif - IrcServerHandler *_ircServerHandler; CoreUserInputHandler *_userInputHandler; - CtcpHandler *_ctcpHandler; QHash _channelKeys; // stores persistent channels and their passwords, if any