X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=e7a8c635d39353dc0837cc415f8cae487e912fe1;hb=b3b83bb123fb3087eba7147539ec0e7a34c6258b;hp=dad8ee2d8f734b0a690ec338ef4f341e94306c1c;hpb=fbb06e36ee772862c0d70ab43c9000225e9f8c42;p=quassel.git diff --git a/src/core/core.h b/src/core/core.h index dad8ee2d..e7a8c635 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,7 @@ #include "authenticator.h" #include "bufferinfo.h" #include "deferredptr.h" +#include "identserver.h" #include "message.h" #include "oidentdconfiggenerator.h" #include "sessionthread.h" @@ -47,10 +49,12 @@ class CoreAuthHandler; class CoreSession; -struct NetworkInfo; +class InternalPeer; class SessionThread; class SignalProxy; +struct NetworkInfo; + class AbstractSqlMigrationReader; class AbstractSqlMigrationWriter; @@ -686,12 +690,23 @@ public: static QString setup(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData, const QString &authenticator, const QVariantMap &authSetupMap); - static inline QTimer &syncTimer() { return instance()->_storageSyncTimer; } + static inline QTimer *syncTimer() { return &instance()->_storageSyncTimer; } inline OidentdConfigGenerator *oidentdConfigGenerator() const { return _oidentdConfigGenerator; } + inline IdentServer *identServer() const { return _identServer; } static const int AddClientEventId; +signals: + //! Sent when a BufferInfo is updated in storage. + void bufferInfoUpdated(UserId user, const BufferInfo &info); + + //! Relay from CoreSession::sessionState(). Used for internal connection only + void sessionState(const Protocol::SessionState &sessionState); + + //! Emitted when database schema upgrade starts or ends + void dbUpgradeInProgress(bool inProgress); + public slots: bool init(); @@ -710,15 +725,9 @@ public slots: void cacheSysIdent(); - void setupInternalClientSession(InternalPeer *clientConnection); QString setupCore(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData, const QString &authenticator, const QVariantMap &authSetupMap); -signals: - //! Sent when a BufferInfo is updated in storage. - void bufferInfoUpdated(UserId user, const BufferInfo &info); - - //! Relay from CoreSession::sessionState(). Used for internal connection only - void sessionState(const Protocol::SessionState &sessionState); + void connectInternalPeer(QPointer peer); protected: void customEvent(QEvent *event) override; @@ -746,6 +755,7 @@ private: void addClientHelper(RemotePeer *peer, UserId uid); //void processCoreSetup(QTcpSocket *socket, QVariantMap &msg); QString setupCoreForInternalUsage(); + void setupInternalClientSession(QPointer peer); bool createUser(); @@ -779,9 +789,10 @@ private: QHash _sessions; DeferredSharedPtr _storage; ///< Active storage backend DeferredSharedPtr _authenticator; ///< Active authenticator - QTimer _storageSyncTimer; QMap _authUserNames; + QTimer _storageSyncTimer; + #ifdef HAVE_SSL SslServer _server, _v6server; #else @@ -795,7 +806,12 @@ private: QDateTime _startTime; - bool _configured; + IdentServer *_identServer {nullptr}; + + bool _initialized{false}; + bool _configured{false}; + + QPointer _pendingInternalConnection; /// Whether or not strict ident mode is enabled, locking users' idents to Quassel username bool _strictIdentEnabled;