#include "corebacklogmanager.h"
#include "corebufferviewmanager.h"
#include "coreirclisthelper.h"
+#include "corenetworkconfig.h"
#include "storage.h"
#include "coreidentity.h"
#include "util.h"
#include "coreusersettings.h"
#include "logger.h"
+#include "coreignorelistmanager.h"
class ProcessMessagesEvent : public QEvent {
public:
_backlogManager(new CoreBacklogManager(this)),
_bufferViewManager(new CoreBufferViewManager(_signalProxy, this)),
_ircListHelper(new CoreIrcListHelper(this)),
+ _networkConfig(new CoreNetworkConfig("GlobalNetworkConfig", this)),
_coreInfo(this),
scriptEngine(new QScriptEngine(this)),
- _processMessages(false)
+ _processMessages(false),
+ _ignoreListManager(this)
{
SignalProxy *p = signalProxy();
connect(p, SIGNAL(peerRemoved(QIODevice *)), this, SLOT(removeClient(QIODevice *)));
p->synchronize(&aliasManager());
p->synchronize(_backlogManager);
p->synchronize(ircListHelper());
+ p->synchronize(networkConfig());
p->synchronize(&_coreInfo);
-
+ p->synchronize(&_ignoreListManager);
// Restore session state
if(restoreState)
restoreSessionState();
void CoreSession::saveSessionState() const {
_bufferSyncer->storeDirtyIds();
_bufferViewManager->saveBufferViews();
+ _networkConfig->save();
}
void CoreSession::restoreSessionState() {
}
void CoreSession::processMessages() {
+ QString networkName;
if(_messageQueue.count() == 1) {
const RawMessage &rawMsg = _messageQueue.first();
BufferInfo bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, rawMsg.bufferType, rawMsg.target);
Message msg(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender, rawMsg.flags);
- Core::storeMessage(msg);
- emit displayMsg(msg);
+
+ networkName = _networks.value(bufferInfo.networkId())->networkName();
+ // if message is ignored with "HardStrictness" we discard it here
+ if(_ignoreListManager.match(msg, networkName) != IgnoreListManager::HardStrictness) {
+ Core::storeMessage(msg);
+ emit displayMsg(msg);
+ }
} else {
QHash<NetworkId, QHash<QString, BufferInfo> > bufferInfoCache;
MessageList messages;
bufferInfo = Core::bufferInfo(user(), rawMsg.networkId, rawMsg.bufferType, rawMsg.target);
bufferInfoCache[rawMsg.networkId][rawMsg.target] = bufferInfo;
}
- messages << Message(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender, rawMsg.flags);
+
+ Message msg(bufferInfo, rawMsg.type, rawMsg.text, rawMsg.sender, rawMsg.flags);
+ networkName = _networks.value(bufferInfo.networkId())->networkName();
+ // if message is ignored with "HardStrictness" we discard it here
+ if(_ignoreListManager.match(msg, networkName) == IgnoreListManager::HardStrictness)
+ continue;
+ messages << msg;
}
Core::storeMessages(messages);
// FIXME: extend protocol to a displayMessages(MessageList)
_identities[identity.id()] = coreIdentity;
// CoreIdentity has it's own synchronize method since it's "private" sslManager needs to be synced aswell
coreIdentity->synchronize(signalProxy());
- connect(coreIdentity, SIGNAL(updated(const QVariantMap &)), this, SLOT(updateIdentityBySender()));
+ connect(coreIdentity, SIGNAL(updated()), this, SLOT(updateIdentityBySender()));
emit identityCreated(*coreIdentity);
}