#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)),
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(_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)
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)