X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=15c95339e9c815a0bb298c52fc5be226602521c1;hp=9967f8020dec30d6ed5039ab0ce8be50f60a31d4;hb=ddfb1d2574c4bffd180361a80df9b1cd584bb040;hpb=c382e0c11f80fb37307ecc42c487aa433c97ad8c diff --git a/src/core/coresession.h b/src/core/coresession.h index 9967f802..15c95339 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -24,7 +24,7 @@ #include #include -#include "corecoreinfo.h" +#include "coreinfo.h" #include "corealiasmanager.h" #include "corehighlightrulemanager.h" #include "coreignorelistmanager.h" @@ -62,14 +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; - 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 +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. @@ -210,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; @@ -223,7 +240,7 @@ private: CoreDccConfig *_dccConfig; CoreIrcListHelper *_ircListHelper; CoreNetworkConfig *_networkConfig; - CoreCoreInfo _coreInfo; + CoreInfo *_coreInfo; CoreTransferManager *_transferManager; EventManager *_eventManager; @@ -241,6 +258,20 @@ 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;