Implement core-side highlights
[quassel.git] / src / core / coresession.h
index 0861b18..3bc7cd0 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 #include "corecoreinfo.h"
 #include "corealiasmanager.h"
 #include "coreignorelistmanager.h"
+#include "peer.h"
 #include "protocol.h"
 #include "message.h"
 #include "storage.h"
+#include "corehighlightrulemanager.h"
 
 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;
@@ -86,7 +88,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 +131,19 @@ public slots:
      */
     void renameBuffer(const NetworkId &networkId, const QString &newName, const QString &oldName);
 
-    QHash<QString, QString> persistentChannels(NetworkId) const;
+    void changePassword(PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword);
+
+    void kickClient(int peerId);
 
-    //! Marks us away (or unaway) on all networks
-    void globalAway(const QString &msg = QString());
+    QHash<QString, QString> persistentChannels(NetworkId) 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 +171,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);
@@ -203,6 +216,7 @@ private:
     CoreBufferSyncer *_bufferSyncer;
     CoreBacklogManager *_backlogManager;
     CoreBufferViewManager *_bufferViewManager;
+    CoreDccConfig *_dccConfig;
     CoreIrcListHelper *_ircListHelper;
     CoreNetworkConfig *_networkConfig;
     CoreCoreInfo _coreInfo;
@@ -216,9 +230,17 @@ 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;
     QList<RawMessage> _messageQueue;
     bool _processMessages;
     CoreIgnoreListManager _ignoreListManager;
+    CoreHighlightRuleManager _highlightRuleManager;
 };