Version: 0.12.5 (using KDE KDE 3.5.6) Installed from: I Don't Know Compiler: gcc OS: Linux When sending rich text messages to clients using gaim and/or trillian, an extra newline is rendered on the receiving end. This is probably due to sending something like "<span>foo bar baz<br></span>" to the server. If there is only one newline in the message, then kopete should remove the "<br>" tag generated from that in order to avoid sending the newline.
Created attachment 20779 [details] screenshot showing the problem This screenshot shows the problem that gaim and trillian clients will see when being on the receiving end of a message from Kopete to either of those clients.
Created attachment 20796 [details] Fixes leftover line-break
SVN commit 673027 by mattr: fix bug 146380 by removing the last <br> tag from the message before sending Based on a patch by Guillermo A. Amaral. Thanks for the patch! The fix should appear in KDE 3.5.8 when/if that is released. BUG: 146380 CCMAIL: me@guillermoamaral.com M +3 -0 aimcontact.cpp --- branches/KDE/3.5/kdenetwork/kopete/protocols/oscar/aim/aimcontact.cpp #673026:673027 @@ -440,6 +440,9 @@ s.replace ( QRegExp ( QString::fromLatin1("<br[ /]*>")), QString::fromLatin1("<br>") ); + // strip left over line break + s.remove( QRegExp( QString::fromLatin1( "<br>$" ) ) ); + kdDebug(14190) << k_funcinfo << "sending " << s << endl;
SVN commit 673098 by mattr: Forward port the fix for bug 146380 to KDE 4. CCBUG: 146380 M +2 -0 aimcontactbase.cpp --- trunk/KDE/kdenetwork/kopete/protocols/oscar/aimcontactbase.cpp #673097:673098 @@ -198,6 +198,8 @@ s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"[^\"]*\">")),QString::fromLatin1("<font size=\"7\">")); s.replace ( QRegExp ( QString::fromLatin1("<br[ /]*>")), QString::fromLatin1("<br>") ); + + s.remove ( QRegExp ( QString::fromLatin1("<br>$") ) ); kDebug(OSCAR_GEN_DEBUG) << k_funcinfo << "sending " << s << endl;
I can also confirm this in jabber in Kopete. Sending rich text messages with jabber results in an extra space below for the reciever. When exporting the message the messages recieved that has the extra spaces looks like: <span style="" class="KopeteMessageBody"><p xmlns="http://www.w3.org/1999/xhtml" style="font-family: Sans Serif; ">Bättre nu?<br xmlns="http://www.w3.org/1999/xhtml"><br> </p></span> and messages sent when Rich text is on looks like: <span style="color: #000000; font-family: DejaVu Sans; " class="KopeteMessageBody"><span style="color:#000000">blir det konstiga mellanrum?</span><br></span> Without rich text there are no <br>s sent.
I am seeing this problem again talking to a friend on AIM with Kopete trunk (r875603). At line 223 of aimcontactbase.cpp, we are stripping <BR> from the end of the string, but that does not take into account any closing tags that may be present (e.g. "<font size='3'>foo<br></font>").
SVN commit 876033 by rjarosz: Strip last BR before we add closing style tags. BUG: 146380 M +3 -3 aimcontactbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=876033
SVN commit 876034 by rjarosz: Backport commit 876033. Strip last BR before we add closing style tags. CCBUG: 146380 M +3 -3 aimcontactbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=876034