Hello all,
With the recent rich text widget patch, yahoo's rich text support was
broken by a bit. The text sent is always white (well actually the
color of the background). This is because the regular expression used
to match colors match both font colors (css "color") and background
color (css "background-color"). The patch attached removes background
color before processing font color thus fixing the problem.
--Benson Tsai
diff --git kopete/protocols/yahoo/yahoocontact.cpp kopete/protocols/yahoo/yahoocontact.cpp
index 6beb68a..54df335 100644
--- kopete/protocols/yahoo/yahoocontact.cpp (revision 923514)
+++ kopete/protocols/yahoo/yahoocontact.cpp (working copy)
@@ -270,7 +270,18 @@ QString YahooContact::prepareMessage( const QString &messageText )
newMsg.replace( regExp, QLatin1String("<span\\1font-style:italic\\2>\033[2m\\3\033[x2m</span>" ) );
}
}
-
+
+ // find and remove background color formattings (not supported)
+ regExp.setPattern( "<span([^>]*)background-color:#([0-9a-zA-Z]*)([^>]*)>(.*)</span>" );
+ pos = 0;
+ while ( pos >= 0 ) {
+ pos = regExp.indexIn( messageText, pos );
+ if ( pos >= 0 ) {
+ pos += regExp.matchedLength();
+ newMsg.replace( regExp, QLatin1String("<span\\1\\3>\\4</span>" ) );
+ }
+ }
+
// find and replace Color-formattings
regExp.setPattern( "<span([^>]*)color:#([0-9a-zA-Z]*)([^>]*)>(.*)</span>" );
pos = 0;
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel