Version: 0.8.0 (using KDE KDE 3.2.0) Installed from: Gentoo Packages Compiler: GCC ~3.3.2 CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe" OS: Linux Alright, I haven't seen anything on this specific issue, so I will detail as much as possible. This only happens with very few people online, and only on Yahoo that I have noticed. I would guess it's a 3rd party app for YMessenger on win32. Here's the error: An internal Kopete error occurred while parsing a message: XML document could not be parsed! I built a custom XSLT, and thought it might be that, but no go... still errors on any other XSLT. Here's the file... RTPG = removed to protect the guilty... <document><message direction="0" importance="1" subject="" mainContactId="RTPG" timestamp="Thu Feb 19 14:58:24 2004" time="02:58:24 pm" > <from> <contact contactId="RTPG" protocolIcon="/usr/kde/3.2/share/apps/kopete/icons/crystalsvg/16x16/apps/yahoo_protocol.png" color="deeppink" > <contactDisplayName dir="ltr" text="RTPG" /> <metaContactDisplayName dir="ltr" text="RTPG" /> </contact> </from> <to> <contact contactId="deadwatch" protocolIcon="/usr/kde/3.2/share/apps/kopete/icons/crystalsvg/16x16/apps/yahoo_protocol.png" > <contactDisplayName dir="ltr" text="deadwatch" /> <metaContactDisplayName dir="ltr" text="deadwatch" /> </contact> </to> <body dir="ltr" color="#000000" font="font-family: Comic Sans MS; " ><![CDATA[[1m<font face="Comic Sans MS">finally u arent busy</ALT>]]></body> </message> <message direction="0" importance="1" subject="" mainContactId="RTPG" timestamp="Thu Feb 19 14:58:24 2004" time="02:58:24 pm" > <from> <contact contactId="RTPG" protocolIcon="/usr/kde/3.2/share/apps/kopete/icons/crystalsvg/16x16/apps/yahoo_protocol.png" color="deeppink" > <contactDisplayName dir="ltr" text="RTPG" /> <metaContactDisplayName dir="ltr" text="RTPG" /> </contact> </from> <to> <contact contactId="deadwatch" protocolIcon="/usr/kde/3.2/share/apps/kopete/icons/crystalsvg/16x16/apps/yahoo_protocol.png" > <contactDisplayName dir="ltr" text="deadwatch" /> <metaContactDisplayName dir="ltr" text="deadwatch" /> </contact> </to> <body dir="ltr" color="#000000" font="font-family: Comic Sans MS; " ><![CDATA[[1m<font face="Comic Sans MS"><img align="center" width="22" height="22" src="/usr/kde/3.2/share/apps/kopete/pics/emoticons/Default/teeth.png" title=":D"/></ALT>]]></body> </message> </document> I think it looks like something to do with... <![CDATA[[1m<font face="Comic It's sending some junk data or something, I don't know.
FYI: the <![CDATA[ is Kopete. The (box)[1m is a Yahoo! colour code. Kopete doesn't strip them out properly. *** This bug has been marked as a duplicate of 75497 ***
Not really a dup since they have different causes... and I can fix this one :)
Mine!
CVS commit by lilachaze: Strip out Yahoo! colour codes from message body. As a side bonus, improve colour code detection. [BACKPORT] CCMAIL: 75646-done@bugs.kde.org M +19 -15 yahooaccount.cpp 1.63.2.1 M +4 -0 yahooaccount.h 1.28.4.1 --- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp #1.63:1.63.2.1 @@ -23,4 +23,5 @@ #include <qdatetime.h> #include <qcolor.h> +#include <qregexp.h> // KDE @@ -123,4 +124,9 @@ void YahooAccount::setImportContacts(boo } +QString YahooAccount::stripMsgColorCodes(const QString& msg) +{ + return QString(msg).remove(QRegExp("\033\\[(..m|#......)")); +} + QColor YahooAccount::getMsgColor(const QString& msg) { @@ -128,29 +134,27 @@ QColor YahooAccount::getMsgColor(const Q * so we have to use this really hacky method to get colors */ - kdDebug(14180) << k_funcinfo << "msg is " << msg << endl; - //If we get here, the message uses a standard Yahoo color - //(selectable from the drop down box) + //kdDebug(14180) << k_funcinfo << "msg is " << msg << endl; //Please note that some of the colors are hard-coded to //match the yahoo colors - if ( msg.find("[38m") != -1 ) + if ( msg.find("\033[38m") != -1 ) return Qt::red; - if ( msg.find("[34m") != -1 ) + if ( msg.find("\033[34m") != -1 ) return Qt::green; - if ( msg.find("[31m") != -1 ) + if ( msg.find("\033[31m") != -1 ) return Qt::blue; - if ( msg.find("[39m") != -1 ) + if ( msg.find("\033[39m") != -1 ) return Qt::yellow; - if ( msg.find("[36m") != -1 ) + if ( msg.find("\033[36m") != -1 ) return Qt::darkMagenta; - if ( msg.find("[32m") != -1 ) + if ( msg.find("\033[32m") != -1 ) return Qt::cyan; - if ( msg.find("[37m") != -1 ) + if ( msg.find("\033[37m") != -1 ) return QColor("#FFAA39"); - if ( msg.find("[35m") != -1 ) + if ( msg.find("\033[35m") != -1 ) return QColor("#FFD8D8"); - if ( msg.find("[#") != -1 ) + if ( msg.find("\033[#") != -1 ) { - kdDebug(14180) << "Custom color is " << msg.mid(msg.find("[#")+1,7) << endl; - return QColor(msg.mid(msg.find("[#")+1,7)); + kdDebug(14180) << "Custom color is " << msg.mid(msg.find("\033[#")+2,7) << endl; + return QColor(msg.mid(msg.find("\033[#")+2,7)); } @@ -482,5 +486,5 @@ void YahooAccount::slotGotIm( const QStr KopeteMessage::Inbound , KopeteMessage::PlainText); - QString newMsg = kmsg.plainBody(); + QString newMsg = stripMsgColorCodes(kmsg.plainBody()); kmsg.setFg(getMsgColor(msg)); --- kdenetwork/kopete/protocols/yahoo/yahooaccount.h #1.28:1.28.4.1 @@ -123,4 +123,8 @@ protected: */ QColor getMsgColor(const QString& msg); + /** + * Remove color codes from a message + */ + QString stripMsgColorCodes(const QString& msg); protected slots: