X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=fe81a2b451c33dc8a12a49994e4c687caf78bf22;hp=0861b18c292b198ccdf5487e939740432cfe7580;hb=cdc6091a2e02b84a48937cda287a0769ceb8726a;hpb=8379f6f725cf8ed2fdad1a19bd10743436c2d086 diff --git a/src/core/coresession.h b/src/core/coresession.h index 0861b18c..fe81a2b4 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 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,9 +24,11 @@ #include #include -#include "corecoreinfo.h" +#include "coreinfo.h" #include "corealiasmanager.h" +#include "corehighlightrulemanager.h" #include "coreignorelistmanager.h" +#include "peer.h" #include "protocol.h" #include "message.h" #include "storage.h" @@ -34,6 +36,7 @@ class CoreBacklogManager; class CoreBufferSyncer; class CoreBufferViewManager; +class CoreDccConfig; class CoreIdentity; class CoreIrcListHelper; class CoreNetwork; @@ -45,7 +48,6 @@ class EventManager; class EventStringifier; class InternalPeer; class IrcParser; -class Peer; class MessageEvent; class NetworkConnection; class RemotePeer; @@ -60,13 +62,24 @@ class CoreSession : public QObject Q_OBJECT public: - CoreSession(UserId, bool restoreState, QObject *parent = 0); + CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject *parent = 0); ~CoreSession(); 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; @@ -86,7 +99,9 @@ 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; } // void attachNetworkConnection(NetworkConnection *conn); @@ -127,12 +142,22 @@ public slots: */ void renameBuffer(const NetworkId &networkId, const QString &newName, const QString &oldName); + void changePassword(PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword); + + void kickClient(int peerId); + QHash persistentChannels(NetworkId) const; - //! Marks us away (or unaway) on all networks - void globalAway(const QString &msg = QString()); + QHash bufferCiphers(NetworkId id) const; + void setBufferCipher(NetworkId id, const QString &bufferName, const QByteArray &cipher) const; - void changePassword(QString password); + /** + * Marks us away (or unaway) on all networks + * + * @param[in] msg Away message, or blank to set unaway + * @param[in] skipFormatting If true, skip timestamp formatting codes (e.g. if already done) + */ + void globalAway(const QString &msg = QString(), const bool skipFormatting = false); signals: void initialized(); @@ -160,7 +185,9 @@ signals: void networkRemoved(NetworkId); void networkDisconnected(NetworkId); - void passwordChangeRequested(UserId user, QString password); + void passwordChanged(PeerPtr peer, bool success); + + void disconnectFromCore(); protected: virtual void customEvent(QEvent *event); @@ -193,6 +220,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; @@ -203,9 +233,10 @@ private: CoreBufferSyncer *_bufferSyncer; CoreBacklogManager *_backlogManager; CoreBufferViewManager *_bufferViewManager; + CoreDccConfig *_dccConfig; CoreIrcListHelper *_ircListHelper; CoreNetworkConfig *_networkConfig; - CoreCoreInfo _coreInfo; + CoreInfo *_coreInfo; CoreTransferManager *_transferManager; EventManager *_eventManager; @@ -216,9 +247,31 @@ private: QScriptEngine *scriptEngine; + /** + * This method obtains the prefixes of the message's sender within a channel, by looking up their channelmodes, and + * processing them to prefixes based on the network's settings. + * @param sender The hostmask of the sender + * @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; };