X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=15c95339e9c815a0bb298c52fc5be226602521c1;hp=d7b2cebb2688c1b7ae1470b356fe65e97930525e;hb=ddfb1d2574c4bffd180361a80df9b1cd584bb040;hpb=dba66762993507168b1a3de25cfd2d7bff0ff969 diff --git a/src/core/coresession.h b/src/core/coresession.h index d7b2cebb..15c95339 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.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 * @@ -24,8 +24,9 @@ #include #include -#include "corecoreinfo.h" +#include "coreinfo.h" #include "corealiasmanager.h" +#include "corehighlightrulemanager.h" #include "coreignorelistmanager.h" #include "peer.h" #include "protocol.h" @@ -61,13 +62,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; + + /** + * 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; @@ -87,6 +98,7 @@ public: inline CoreIrcListHelper *ircListHelper() const { return _ircListHelper; } inline CoreIgnoreListManager *ignoreListManager() { return &_ignoreListManager; } + inline HighlightRuleManager *highlightRuleManager() { return &_highlightRuleManager; } inline CoreTransferManager *transferManager() const { return _transferManager; } inline CoreDccConfig *dccConfig() const { return _dccConfig; } @@ -99,6 +111,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. @@ -131,8 +148,13 @@ public slots: void changePassword(PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword); + void kickClient(int peerId); + QHash persistentChannels(NetworkId) const; + QHash bufferCiphers(NetworkId id) const; + void setBufferCipher(NetworkId id, const QString &bufferName, const QByteArray &cipher) const; + /** * Marks us away (or unaway) on all networks * @@ -169,6 +191,8 @@ signals: void passwordChanged(PeerPtr peer, bool success); + void disconnectFromCore(); + protected: virtual void customEvent(QEvent *event); @@ -200,6 +224,9 @@ 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; @@ -213,7 +240,7 @@ private: CoreDccConfig *_dccConfig; CoreIrcListHelper *_ircListHelper; CoreNetworkConfig *_networkConfig; - CoreCoreInfo _coreInfo; + CoreInfo *_coreInfo; CoreTransferManager *_transferManager; EventManager *_eventManager; @@ -231,9 +258,24 @@ private: * @param bufferInfo The BufferInfo object of the buffer */ QString senderPrefixes(const QString &sender, const BufferInfo &bufferInfo) const; + + /** + * This method obtains the realname of the message's sender. + * @param sender The hostmask of the sender + * @param networkId The network the user is on + */ + QString realName(const QString &sender, NetworkId networkId) const; + + /** + * This method obtains the avatar of the message's sender. + * @param sender The hostmask of the sender + * @param networkId The network the user is on + */ + QString avatarUrl(const QString &sender, NetworkId networkId) const; QList _messageQueue; bool _processMessages; CoreIgnoreListManager _ignoreListManager; + CoreHighlightRuleManager _highlightRuleManager; };