X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=b4903ff4347c2307d416e7c7676b29175b65ff2c;hb=d9e586707522241d628a90466e13722e342cc28a;hp=72843a5ff13a25efc7ccfbe42b650587ce46343a;hpb=20f446a492d8e681156423f0dc3637db78c45bae;p=quassel.git diff --git a/src/core/coresession.h b/src/core/coresession.h index 72843a5f..b4903ff4 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef CORESESSION_H -#define CORESESSION_H +#pragma once +#include +#include #include #include -#include "corecoreinfo.h" +#include "coreinfo.h" #include "corealiasmanager.h" #include "corehighlightrulemanager.h" #include "coreignorelistmanager.h" @@ -62,14 +63,23 @@ class CoreSession : public QObject Q_OBJECT public: - CoreSession(UserId, bool restoreState, QObject *parent = 0); - ~CoreSession(); + CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = 0); QList buffers() const; inline UserId user() const { return _user; } CoreNetwork *network(NetworkId) const; CoreIdentity *identity(IdentityId) const; - const QString strictSysident(); + + /** + * Returns the optionally strict-compliant ident for the given user identity + * + * If strict mode is enabled, this will return the user's Quassel username for any identity, + * otherwise this will return the given identity's ident, whatever it may be. + * + * @return The user's ident, compliant with strict mode (when enabled) + */ + const QString strictCompliantIdent(const CoreIdentity *identity); + inline CoreNetworkConfig *networkConfig() const { return _networkConfig; } NetworkConnection *networkConnection(NetworkId) const; @@ -102,6 +112,11 @@ public slots: void addClient(RemotePeer *peer); void addClient(InternalPeer *peer); + /** + * Shuts down the session and deletes itself afterwards. + */ + void shutdown(); + void msgFromClient(BufferInfo, QString message); //! Create an identity and propagate the changes to the clients. @@ -199,6 +214,8 @@ private slots: void saveSessionState() const; + void onNetworkDisconnected(NetworkId networkId); + private: void processMessages(); @@ -210,12 +227,15 @@ private: UserId _user; + /// Whether or not strict ident mode is enabled, locking users' idents to Quassel username + bool _strictIdentEnabled; + SignalProxy *_signalProxy; CoreAliasManager _aliasManager; - // QHash _connections; - QHash _networks; - // QHash _networksToRemove; + QHash _identities; + QHash _networks; + QSet _networksPendingDisconnect; CoreBufferSyncer *_bufferSyncer; CoreBacklogManager *_backlogManager; @@ -223,7 +243,7 @@ private: CoreDccConfig *_dccConfig; CoreIrcListHelper *_ircListHelper; CoreNetworkConfig *_networkConfig; - CoreCoreInfo _coreInfo; + CoreInfo *_coreInfo; CoreTransferManager *_transferManager; EventManager *_eventManager; @@ -273,5 +293,3 @@ struct RawMessage { RawMessage(NetworkId networkId, Message::Type type, BufferInfo::Type bufferType, const QString &target, const QString &text, const QString &sender, Message::Flags flags) : networkId(networkId), type(type), bufferType(bufferType), target(target), text(text), sender(sender), flags(flags) {} }; - -#endif