X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fauthhandler.h;h=cc03588ed2479e3efc6531b9a1e1de2f8248c5d1;hp=200e0a1cc243b63fe39b33c6b861b98174bc7297;hb=447501045b6fe14fdeff95823e2ea85416da7a77;hpb=9d54503555534a2c554f09a33df6afa33d6308ec diff --git a/src/common/authhandler.h b/src/common/authhandler.h index 200e0a1c..cc03588e 100644 --- a/src/common/authhandler.h +++ b/src/common/authhandler.h @@ -32,22 +32,12 @@ class AuthHandler : public QObject Q_OBJECT public: - enum State { - UnconnectedState, - HostLookupState, - ConnectingState, - ConnectedState, - RetryWithLegacyState, - AuthenticatingState, - AuthenticatedState, - ClosingState - }; - AuthHandler(QObject *parent = 0); - State state() const; QTcpSocket *socket() const; + bool isLocal() const; + virtual void handle(const Protocol::RegisterClient &) { invalidMessage(); } virtual void handle(const Protocol::ClientDenied &) { invalidMessage(); } virtual void handle(const Protocol::ClientRegistered &) { invalidMessage(); } @@ -67,24 +57,19 @@ public slots: void close(); signals: - void stateChanged(State state); void disconnected(); - - void socketStateChanged(QAbstractSocket::SocketState state); void socketError(QAbstractSocket::SocketError error, const QString &errorString); protected: void setSocket(QTcpSocket *socket); - void setState(State state); -private slots: - void onSocketError(QAbstractSocket::SocketError error); - void onSocketDisconnected(); +protected slots: + virtual void onSocketError(QAbstractSocket::SocketError error); + virtual void onSocketDisconnected(); private: void invalidMessage(); - State _state; QTcpSocket *_socket; // FIXME: should be a QSharedPointer? -> premature disconnect before the peer has taken over bool _disconnectedSent; };