X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.cpp;h=926fc97635f502c78967d228916e1c08c1aa277d;hp=1e7d2a1e4cc236e6737b0fa65e858ea0deb03024;hb=35e22cad1de9084bc3ddf664bc43e5a620adf1ae;hpb=93800658bba5dcbeca7f3deb02dd7091c455efe8 diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 1e7d2a1e..926fc976 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -68,7 +68,7 @@ CoreSession::CoreSession(UserId uid, bool restoreState, QObject *parent) 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(); @@ -182,7 +182,6 @@ void CoreSession::removeClient(QIODevice *iodev) { QHash CoreSession::persistentChannels(NetworkId id) const { return Core::persistentChannels(user(), id); - return QHash(); } // FIXME switch to BufferId @@ -307,7 +306,7 @@ void CoreSession::removeIdentity(IdentityId id) { /*** Network Handling ***/ -void CoreSession::createNetwork(const NetworkInfo &info_) { +void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &persistentChans) { NetworkInfo info = info_; int id; @@ -331,6 +330,11 @@ void CoreSession::createNetwork(const NetworkInfo &info_) { _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); @@ -375,7 +379,6 @@ void CoreSession::clientsConnected() { Identity *identity = 0; CoreNetwork *net = 0; IrcUser *me = 0; - QString awayReason; while(netIter != _networks.end()) { net = *netIter; netIter++; @@ -417,8 +420,6 @@ void CoreSession::clientsDisconnected() { if(identity->detachAwayEnabled() && !me->isAway()) { if(identity->detachAwayReasonEnabled()) awayReason = identity->detachAwayReason(); - else - awayReason = identity->awayReason(); net->setAutoAwayActive(true); net->userInputHandler()->handleAway(BufferInfo(), awayReason); }