/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "clientuserinputhandler.h"
#include "coreaccountmodel.h"
#include "coreconnection.h"
+#include "dccconfig.h"
#include "ircchannel.h"
#include "ircuser.h"
#include "message.h"
#include "networkmodel.h"
#include "quassel.h"
#include "signalproxy.h"
+#include "transfermodel.h"
#include "util.h"
#include "clientauthhandler.h"
_backlogManager(new ClientBacklogManager(this)),
_bufferViewManager(0),
_bufferViewOverlay(new BufferViewOverlay(this)),
+ _dccConfig(0),
_ircListHelper(new ClientIrcListHelper(this)),
_inputHandler(0),
_networkConfig(0),
_ignoreListManager(0),
_transferManager(0),
+ _transferModel(new TransferModel(this)),
_messageModel(0),
_messageProcessor(0),
_coreAccountModel(new CoreAccountModel(this)),
connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), this, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), _messageModel, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
connect(bufferSyncer(), SIGNAL(bufferMarkedAsRead(BufferId)), SIGNAL(bufferMarkedAsRead(BufferId)));
+ connect(bufferSyncer(), SIGNAL(bufferActivityChange(BufferId, const Message::Types)), _networkModel, SLOT(bufferActivityChanged(BufferId, const Message::Types)));
connect(networkModel(), SIGNAL(requestSetLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
SignalProxy *p = signalProxy();
_ignoreListManager = new ClientIgnoreListManager(this);
p->synchronize(ignoreListManager());
+ // create TransferManager and DccConfig if core supports them
+ Q_ASSERT(!_dccConfig);
Q_ASSERT(!_transferManager);
- _transferManager = new ClientTransferManager(this);
- p->synchronize(transferManager());
+ if (coreFeatures() & Quassel::DccFileTransfer) {
+ _dccConfig = new DccConfig(this);
+ p->synchronize(dccConfig());
+ _transferManager = new ClientTransferManager(this);
+ _transferModel->setManager(_transferManager);
+ p->synchronize(transferManager());
+ }
// trigger backlog request once all active bufferviews are initialized
- connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+ connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
_connected = true;
emit connected();
emit coreConnectionStateChanged(true);
}
-
-void Client::requestInitialBacklog()
+void Client::finishConnectionInitialization()
{
// usually it _should_ take longer until the bufferViews are initialized, so that's what
// triggers this slot. But we have to make sure that we know all buffers yet.
// so we check the BufferSyncer and in case it wasn't initialized we wait for that instead
if (!bufferSyncer()->isInitialized()) {
- disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
- connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+ disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+ connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
return;
}
- disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
- disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+ disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+ disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+
+ requestInitialBacklog();
+ bufferSyncer()->markActivitiesChanged();
+}
+
+void Client::requestInitialBacklog()
+{
_backlogManager->requestInitialBacklog();
}
}
if (_transferManager) {
+ _transferModel->setManager(nullptr);
_transferManager->deleteLater();
- _transferManager = 0;
+ _transferManager = nullptr;
+ }
+
+ if (_dccConfig) {
+ _dccConfig->deleteLater();
+ _dccConfig = nullptr;
}
// we probably don't want to save pending input for reconnect