p->attachSignal(this, SIGNAL(networkCreated(NetworkId)));
p->attachSignal(this, SIGNAL(networkRemoved(NetworkId)));
- p->attachSlot(SIGNAL(createNetwork(const NetworkInfo &)), this, SLOT(createNetwork(const NetworkInfo &)));
+ p->attachSlot(SIGNAL(createNetwork(const NetworkInfo &, const QStringList &)), this, SLOT(createNetwork(const NetworkInfo &, const QStringList &)));
p->attachSlot(SIGNAL(removeNetwork(NetworkId)), this, SLOT(removeNetwork(NetworkId)));
loadSettings();
QHash<QString, QString> CoreSession::persistentChannels(NetworkId id) const {
return Core::persistentChannels(user(), id);
- return QHash<QString, QString>();
}
// FIXME switch to BufferId
/*** Network Handling ***/
-void CoreSession::createNetwork(const NetworkInfo &info_) {
+void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &persistentChans) {
NetworkInfo info = info_;
int id;
_networks[id] = net;
signalProxy()->synchronize(net);
emit networkCreated(id);
+ // create persistent chans
+ foreach(QString channel, persistentChans) {
+ Core::bufferInfo(user(), info.networkId, BufferInfo::ChannelBuffer, channel, true);
+ Core::setChannelPersistent(user(), info.networkId, channel, true);
+ }
} else {
qWarning() << qPrintable(tr("CoreSession::createNetwork(): Trying to create a network that already exists, updating instead!"));
_networks[info.networkId]->requestSetNetworkInfo(info);
Identity *identity = 0;
CoreNetwork *net = 0;
IrcUser *me = 0;
- QString awayReason;
while(netIter != _networks.end()) {
net = *netIter;
netIter++;
if(identity->detachAwayEnabled() && !me->isAway()) {
if(identity->detachAwayReasonEnabled())
awayReason = identity->detachAwayReason();
- else
- awayReason = identity->awayReason();
net->setAutoAwayActive(true);
net->userInputHandler()->handleAway(BufferInfo(), awayReason);
}