core: Fix SQLite realname/avatarurl handling
[quassel.git] / src / core / coresession.h
index 849575f..72843a5 100644 (file)
@@ -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  *
@@ -26,6 +26,7 @@
 
 #include "corecoreinfo.h"
 #include "corealiasmanager.h"
+#include "corehighlightrulemanager.h"
 #include "coreignorelistmanager.h"
 #include "peer.h"
 #include "protocol.h"
@@ -68,6 +69,7 @@ public:
     inline UserId user() const { return _user; }
     CoreNetwork *network(NetworkId) const;
     CoreIdentity *identity(IdentityId) const;
+    const QString strictSysident();
     inline CoreNetworkConfig *networkConfig() const { return _networkConfig; }
     NetworkConnection *networkConnection(NetworkId) const;
 
@@ -87,6 +89,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; }
 
@@ -131,8 +134,13 @@ public slots:
 
     void changePassword(PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword);
 
+    void kickClient(int peerId);
+
     QHash<QString, QString> persistentChannels(NetworkId) const;
 
+    QHash<QString, QByteArray> 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 +177,8 @@ signals:
 
     void passwordChanged(PeerPtr peer, bool success);
 
+    void disconnectFromCore();
+
 protected:
     virtual void customEvent(QEvent *event);
 
@@ -224,9 +234,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<RawMessage> _messageQueue;
     bool _processMessages;
     CoreIgnoreListManager _ignoreListManager;
+    CoreHighlightRuleManager _highlightRuleManager;
 };