X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresession.cpp;h=13e8462de38df2b11fa253c97a8f322f8e3f15bb;hb=860dfc7ed65d6810cd759b1f92c2c18616c02393;hp=926fc97635f502c78967d228916e1c08c1aa277d;hpb=35e22cad1de9084bc3ddf664bc43e5a620adf1ae;p=quassel.git diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 926fc976..13e8462d 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -201,6 +201,11 @@ void CoreSession::recvMessageFromServer(Message::Type type, BufferInfo::Type buf CoreNetwork *net = qobject_cast(this->sender()); Q_ASSERT(net); + // U+FDD0 and U+FDD1 are special characters for Qt's text engine, specifically they mark the boundaries of + // text frames in a QTextDocument. This might lead to problems in widgets displaying QTextDocuments (such as + // KDE's notifications), hence we remove those just to be safe. + text.remove(QChar(0xfdd0)).remove(QChar(0xfdd1)); + BufferInfo bufferInfo = Core::bufferInfo(user(), net->networkId(), bufferType, target); Message msg(bufferInfo, type, text, sender, flags); msg.setMsgId(Core::storeMessage(msg)); @@ -320,6 +325,20 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per id = info.networkId.toInt(); if(!_networks.contains(id)) { + + // create persistent chans + QRegExp rx("\\s*(\\S+)(?:\\s*(\\S+))?\\s*"); + foreach(QString channel, persistentChans) { + if(!rx.exactMatch(channel)) { + qWarning() << QString("Invalid persistent channel declaration: %1").arg(channel); + continue; + } + Core::bufferInfo(user(), info.networkId, BufferInfo::ChannelBuffer, rx.cap(1), true); + Core::setChannelPersistent(user(), info.networkId, rx.cap(1), true); + if(!rx.cap(2).isEmpty()) + Core::setPersistentChannelKey(user(), info.networkId, rx.cap(1), rx.cap(2)); + } + CoreNetwork *net = new CoreNetwork(id, this); connect(net, SIGNAL(displayMsg(Message::Type, BufferInfo::Type, QString, QString, QString, Message::Flags)), this, SLOT(recvMessageFromServer(Message::Type, BufferInfo::Type, QString, QString, QString, Message::Flags))); @@ -330,11 +349,6 @@ void CoreSession::createNetwork(const NetworkInfo &info_, const QStringList &per _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); @@ -418,7 +432,7 @@ void CoreSession::clientsDisconnected() { continue; if(identity->detachAwayEnabled() && !me->isAway()) { - if(identity->detachAwayReasonEnabled()) + if(!identity->detachAwayReason().isEmpty()) awayReason = identity->detachAwayReason(); net->setAutoAwayActive(true); net->userInputHandler()->handleAway(BufferInfo(), awayReason);