From: Manuel Nickschas Date: Tue, 19 May 2009 00:28:49 +0000 (+0200) Subject: Filter some unicode control codes out of IRC messages X-Git-Tag: 0.4.2~1 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=137d98841d0ca720732b9d47658170b0421d86bc Filter some unicode control codes out of IRC messages U+FDD0 and U+FDD1 are for internal Qt use and might screw up some Qt widgets if used inappropriately. Hence, we filter them out of incoming messages. Thanks to Sho_ and the Konversation team for the heads-up! --- diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 0fbfed4d..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));