#include "coreeventmanager.h"
#include "coreidentity.h"
#include "coreignorelistmanager.h"
+#include "coreinfo.h"
#include "coreirclisthelper.h"
#include "corenetwork.h"
#include "corenetworkconfig.h"
#include "ircchannel.h"
#include "ircparser.h"
#include "ircuser.h"
-#include "logger.h"
+#include "logmessage.h"
#include "messageevent.h"
#include "remotepeer.h"
#include "storage.h"
};
-CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent)
+CoreSession::CoreSession(UserId uid, bool restoreState, bool strictIdentEnabled, QObject *parent)
: QObject(parent),
_user(uid),
+ _strictIdentEnabled(strictIdentEnabled),
_signalProxy(new SignalProxy(SignalProxy::Server, this)),
_aliasManager(this),
_bufferSyncer(new CoreBufferSyncer(this)),
_dccConfig(new CoreDccConfig(this)),
_ircListHelper(new CoreIrcListHelper(this)),
_networkConfig(new CoreNetworkConfig("GlobalNetworkConfig", this)),
- _coreInfo(this),
+ _coreInfo(new CoreInfo(this)),
_transferManager(new CoreTransferManager(this)),
_eventManager(new CoreEventManager(this)),
_eventStringifier(new EventStringifier(this)),
p->attachSlot(SIGNAL(kickClient(int)), this, SLOT(kickClient(int)));
p->attachSignal(this, SIGNAL(disconnectFromCore()));
+ QVariantMap data;
+ data["quasselVersion"] = Quassel::buildInfo().fancyVersionString;
+ data["quasselBuildDate"] = Quassel::buildInfo().commitDate; // "BuildDate" for compatibility
+ data["startTime"] = Core::instance()->startTime();
+ data["sessionConnectedClients"] = 0;
+ _coreInfo->setCoreData(data);
+
loadSettings();
initScriptEngine();
eventManager()->registerObject(ctcpParser(), EventManager::LowPriority, "send");
// periodically save our session state
- connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), this, SLOT(saveSessionState()));
+ connect(Core::instance()->syncTimer(), SIGNAL(timeout()), this, SLOT(saveSessionState()));
p->synchronize(_bufferSyncer);
p->synchronize(&aliasManager());
p->synchronize(dccConfig());
p->synchronize(ircListHelper());
p->synchronize(networkConfig());
- p->synchronize(&_coreInfo);
+ p->synchronize(_coreInfo);
p->synchronize(&_ignoreListManager);
p->synchronize(&_highlightRuleManager);
+ // Listen to network removed events
+ connect(this, SIGNAL(networkRemoved(NetworkId)),
+ &_highlightRuleManager, SLOT(networkRemoved(NetworkId)));
p->synchronize(transferManager());
// Restore session state
if (restoreState)
peer->dispatch(sessionState());
signalProxy()->addPeer(peer);
+ _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
signalProxy()->setTargetPeer(nullptr);
}
RemotePeer *p = qobject_cast<RemotePeer *>(peer);
if (p)
quInfo() << qPrintable(tr("Client")) << p->description() << qPrintable(tr("disconnected (UserId: %1).").arg(user().toInt()));
+ _coreInfo->setConnectedClientData(signalProxy()->peerCount(), signalProxy()->peerData());
}
if (_ignoreListManager.match(rawMsg, networkName) == IgnoreListManager::HardStrictness)
return;
- if (_highlightRuleManager.match(rawMsg, currentNetwork->myNick(), currentNetwork->identityPtr()->nicks()))
+
+ if (currentNetwork && _highlightRuleManager.match(rawMsg, currentNetwork->myNick(), currentNetwork->identityPtr()->nicks()))
rawMsg.flags |= Message::Flag::Highlight;
_messageQueue << rawMsg;
createIdentity(coreIdentity);
}
-const QString CoreSession::strictSysident() {
- return Core::instance()->strictSysIdent(_user);
+const QString CoreSession::strictCompliantIdent(const CoreIdentity *identity) {
+ if (_strictIdentEnabled) {
+ // Strict mode enabled: only allow the user's Quassel username as an ident
+ return Core::instance()->strictSysIdent(_user);
+ } else {
+ // Strict mode disabled: allow any identity specified
+ return identity->ident();
+ }
}
void CoreSession::createIdentity(const CoreIdentity &identity)