Bug 175532 - Outgoing AIM (OSCAR) messages have HTML line break tag (<BR>) prepended
Summary: Outgoing AIM (OSCAR) messages have HTML line break tag (<BR>) prepended
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: ICQ and AIM Plugins (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-19 00:07 UTC by Dustin Marquess
Modified: 2008-12-07 12:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix br tags (2.52 KB, patch)
2008-11-29 13:59 UTC, Roman Jarosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dustin Marquess 2008-11-19 00:07:31 UTC
Version:           0.60.80 (using KDE 4.1.3)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    SuSE RPMs

When sending messages in Kopete to AIM users, all outgoing messages have a HTML line break (<BR>) prepended.  This shows up as a empty blank line on the receiving side.  Confirmed <BR> is sent using strace.  <BR> is sent on both using the Enter/Return key to send and also clicking the 'Send' button.  Only kopete plugins enabled are History & OTR.

Originally noticed in openSUSE 11.1 Beta 5 & KDE 4.1.3.  Reproduced in openSUSE Factory & KDE4:UNSTABLE (KDE-4.1.73).

I'm not sure what the proper fix is, but the following patch appears to work around the problem:

--- kopete/protocols/oscar/aimcontactbase.cpp   2008-10-30 09:17:58.000000000 -0500
+++ kopete/protocols/oscar/aimcontactbase.cpp   2008-11-18 14:58:49.141797950 -0600
@@ -164,6 +164,9 @@
        if ( s.endsWith( "<BR>" ) )
                s.chop(4);

+       if ( s.startsWith( "<BR>" ) )
+               s.remove(0,4);
+
        if ( hasFontTag )
                s += "</FONT>";
        if ( defaultCharFormat.font().bold() )
Comment 1 Drew Fisher 2008-11-19 21:45:53 UTC
I've noticed this one for quite some time!  Behavior confirmed in SVN r886275, patch fixes the bug for me.
Comment 2 Roman Jarosz 2008-11-29 13:59:27 UTC
Created attachment 28922 [details]
Fix br tags

This patch should fix this bug and also should fix wrong amount of br if the text has more successive line breaks. If you can please test it.
Comment 3 Roman Jarosz 2008-12-07 12:18:36 UTC
SVN commit 893722 by rjarosz:

Fix bug 175532 Outgoing AIM messages have HTML line break prepended.

BUG: 175532


 M  +14 -6     aimcontactbase.cpp  
 M  +1 -1      aimcontactbase.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=893722
Comment 4 Roman Jarosz 2008-12-07 12:20:17 UTC
SVN commit 893723 by rjarosz:

Backport fix for bug 175532 Outgoing AIM messages have HTML line break prepended.

CCBUG: 175532



 M  +14 -6     aimcontactbase.cpp  
 M  +1 -1      aimcontactbase.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=893723