X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=83e8786418bf02a9d57ac28c2237f04a19b27ab2;hb=48017b680ede0dbfb121d1184dfbd13536cfc53f;hp=5a05f024106a40077cf843ac6fe570a9b41bf971;hpb=d030c159599a22c9023b8f0d34909d3277707f52;p=quassel.git diff --git a/src/core/coresession.h b/src/core/coresession.h index 5a05f024..83e87864 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,6 +21,7 @@ #pragma once #include +#include #include #include @@ -32,6 +33,7 @@ #include "coreignorelistmanager.h" #include "coreinfo.h" #include "message.h" +#include "metricsserver.h" #include "peer.h" #include "protocol.h" #include "storage.h" @@ -57,8 +59,6 @@ class SignalProxy; struct NetworkInfo; -class QScriptEngine; - class CoreSession : public QObject { Q_OBJECT @@ -66,7 +66,7 @@ class CoreSession : public QObject public: CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject* parent = nullptr); - QList buffers() const; + std::vector buffers() const; inline UserId user() const { return _user; } CoreNetwork* network(NetworkId) const; CoreIdentity* identity(IdentityId) const; @@ -172,8 +172,6 @@ signals: void displayMsg(Message message); void displayStatusMsg(QString, QString); - void scriptResult(QString result); - //! Identity has been created. /** This signal is propagated to the clients to tell them that the given identity has been created. * \param identity The new identity. @@ -205,8 +203,6 @@ private slots: void destroyNetwork(NetworkId); - void scriptRequest(QString script); - void clientsConnected(); void clientsDisconnected(); @@ -220,7 +216,6 @@ private: void processMessages(); void loadSettings(); - void initScriptEngine(); /// Hook for converting events to the old displayMsg() handlers Q_INVOKABLE void processMessageEvent(MessageEvent* event); @@ -252,8 +247,6 @@ private: CtcpParser* _ctcpParser; IrcParser* _ircParser; - 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. @@ -279,6 +272,7 @@ private: bool _processMessages; CoreIgnoreListManager _ignoreListManager; CoreHighlightRuleManager _highlightRuleManager; + MetricsServer* _metricsServer{nullptr}; }; struct NetworkInternalMessage @@ -289,7 +283,12 @@ struct NetworkInternalMessage QString text; QString sender; Message::Flags flags; - NetworkInternalMessage(Message::Type type, BufferInfo::Type bufferType, QString target, QString text, QString sender = "", Message::Flags flags = Message::None) + NetworkInternalMessage(Message::Type type, + BufferInfo::Type bufferType, + QString target, + QString text, + QString sender = "", + Message::Flags flags = Message::None) : type(type) , bufferType(bufferType) , target(std::move(target)) @@ -301,6 +300,7 @@ struct NetworkInternalMessage struct RawMessage { + QDateTime timestamp; NetworkId networkId; Message::Type type; BufferInfo::Type bufferType; @@ -308,9 +308,17 @@ struct RawMessage QString text; QString sender; Message::Flags flags; - RawMessage( - NetworkId networkId, Message::Type type, BufferInfo::Type bufferType, QString target, QString text, QString sender, Message::Flags flags) - : networkId(networkId) + + RawMessage(QDateTime timestamp, + NetworkId networkId, + Message::Type type, + BufferInfo::Type bufferType, + QString target, + QString text, + QString sender, + Message::Flags flags) + : timestamp(std::move(timestamp)) + , networkId(networkId) , type(type) , bufferType(bufferType) , target(std::move(target)) @@ -319,8 +327,10 @@ struct RawMessage , flags(flags) {} - RawMessage(NetworkId networkId, const NetworkInternalMessage& msg) - : networkId(networkId) + RawMessage(NetworkId networkId, + const NetworkInternalMessage& msg) + : timestamp(QDateTime::currentDateTimeUtc()) + , networkId(networkId) , type(msg.type) , bufferType(msg.bufferType) , target(msg.target)