/***************************************************************************
- * 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 *
#pragma once
#include <utility>
+#include <vector>
#include <QHash>
#include <QSet>
#include "coreignorelistmanager.h"
#include "coreinfo.h"
#include "message.h"
+#include "metricsserver.h"
#include "peer.h"
#include "protocol.h"
#include "storage.h"
struct NetworkInfo;
-class QScriptEngine;
-
class CoreSession : public QObject
{
Q_OBJECT
public:
CoreSession(UserId, bool restoreState, bool strictIdentEnabled, QObject* parent = nullptr);
- QList<BufferInfo> buffers() const;
+ std::vector<BufferInfo> buffers() const;
inline UserId user() const { return _user; }
CoreNetwork* network(NetworkId) const;
CoreIdentity* identity(IdentityId) const;
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.
void destroyNetwork(NetworkId);
- void scriptRequest(QString script);
-
void clientsConnected();
void clientsDisconnected();
void processMessages();
void loadSettings();
- void initScriptEngine();
/// Hook for converting events to the old displayMsg() handlers
Q_INVOKABLE void processMessageEvent(MessageEvent* event);
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.
bool _processMessages;
CoreIgnoreListManager _ignoreListManager;
CoreHighlightRuleManager _highlightRuleManager;
+ MetricsServer* _metricsServer{nullptr};
};
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))
struct RawMessage
{
+ QDateTime timestamp;
NetworkId networkId;
Message::Type type;
BufferInfo::Type bufferType;
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))
, 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)