Bug 121627 - Jabber plugin sends empty lines (or CRs ?) before and after a message
Summary: Jabber plugin sends empty lines (or CRs ?) before and after a message
Status: CONFIRMED
Alias: None
Product: kopete
Classification: Applications
Component: Jabber Plugin (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 122972 122992 124853 129120 145895 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-09 00:43 UTC by Thanos Kyritsis
Modified: 2021-03-09 22:40 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is what the adium user sees. (53.79 KB, image/png)
2006-02-09 00:44 UTC, Thanos Kyritsis
Details
And this is what kopete user sends. (61.56 KB, image/png)
2006-02-09 00:45 UTC, Thanos Kyritsis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thanos Kyritsis 2006-02-09 00:43:07 UTC
Version:           0.12-alpha1 (using KDE KDE 3.5.1)
Installed from:    Slackware Packages
Compiler:          gcc 3.4.5 
OS:                Linux

I was chating with an Adium user and he mentioned that while messaging via Jabber there are some empty lines (spaces) (CRs ? \n ?) before and after my messages.

This is happening only when messaging over Jabber and not occuring when messaging via other protocols.

I'll post screenshots with what I (kopete) see and what he (Adium) sees.
Comment 1 Thanos Kyritsis 2006-02-09 00:44:05 UTC
Created attachment 14613 [details]
This is what the adium user sees.
Comment 2 Thanos Kyritsis 2006-02-09 00:45:30 UTC
Created attachment 14614 [details]
And this is what kopete user sends.
Comment 3 Michaël Larouche 2006-02-09 20:14:38 UTC
I've reprocuced the bug. By looking the debug output I can tell you it's not sending extra empty lines.

"<message from="user@server/Kopete" type="chat" id="aae4a" to="user@server/Gaim" >
<body>test</body>
<html xmlns="http://jabber.org/protocol/xhtml-im">
<body xmlns="http://www.w3.org/1999/xhtml" style="font-family: Bitstream Vera Sans; font-weight: bold;" >
<span style="font-weight:400" >test</span>
</body>
</html>
<x xmlns="jabber:x:event">
<offline/>
<composing/>
<delivered/>
<displayed/>
</x>
</message>
"

So it's look like a bug in libgaim(used by Adium too) while proceding XHTML body.
Comment 4 Thanos Kyritsis 2006-02-09 20:40:57 UTC
Ok. Then there must be an explanation why chatting with the same Adium user and me using kopete 0.11.1, 0.11.0 or 0.10.x kopete does not trigger the same bug in libgaim (always speaking for Jabber).

And why the same *HTML content gets displayed correctly for other protocols (MSN, AIM) ? Ok, they are not the same protocol plugins, but it's the same simple body tag.

Would there be any chance that the problem is created by some of the other tags ? There is no p tag in the transmitted xhtml but perhaps it's because some other tag was added or removed compared to what xhtml tags were transmitted by kopete 0.11.x.
Comment 5 Olivier Goffart 2006-02-09 22:14:04 UTC
> there must be an explanation why chatting with the same Adium user and 
> me using [old kopete] does not trigger the same bug

The support of rich text in message (JEP-0071) is new in Kopete 0.12
(Before, message were just plain text)
You can still disable it, i think there is a button in the toolbar to do that.
So it may fix your problem.

> And why the same *HTML content gets displayed correctly 
> for other protocols (MSN, AIM) ? 

Each protocols has different way for sending message.

* Jabber is basically plain text, but may be XHTML for formating (according to JEP-0071)
* MSN is plain text, and has metadata for colors and font
* ICQ/AIM  is HTML

Each protocol take care to transform the message in the correct form according.

> Would there be any chance that the problem is created by some of the
> other tags ?

Maybe it's because carriage return.

Comment 6 Thanos Kyritsis 2006-02-09 23:06:47 UTC
> The support of rich text in message (JEP-0071) is new in Kopete 0.12
> (Before, message were just plain text)
> You can still disable it, i think there is a button in the toolbar to do that.
> So it may fix your problem.

Yes! That's it. Thanks very much Olivier :)

I disabled rich text and the Adium/libgaim client is not receiving those Carriage Returns any more.

Hmmm, now if only I could set a configuration option for globally or per protocol disabling rich text :>
Comment 7 Matt Rogers 2006-03-04 17:06:59 UTC
*** Bug 122972 has been marked as a duplicate of this bug. ***
Comment 8 Matt Rogers 2006-03-04 17:07:28 UTC
*** Bug 122992 has been marked as a duplicate of this bug. ***
Comment 9 Tobias Haf 2006-03-13 13:04:17 UTC
Yeah, any hints for configuring this globally?
Comment 10 Olivier Goffart 2006-03-31 16:44:58 UTC
SVN commit 524990 by ogoffart:

Fix Bug 121627: Jabber plugin sends empty lines (or CRs ?) before and after a message

Removes all \n that KTextEdit add for html indentation.

BUG: 121627




 M  +5 -1      jabberchatsession.cpp   [UTF-8 ENCODING PROBLEMS]


--- branches/kopete/0.12/kopete/protocols/jabber/jabberchatsession.cpp #524989:524990
@@ -251,7 +251,11 @@
 				JabberResource *bestResource = account()->resourcePool()->bestJabberResource(toJid);
 				if( bestResource && bestResource->features().canXHTML() )
 				{
-					jabberMessage.setXHTMLBody ( message.escapedBody(), QString::null, message.getHtmlStyleAttribute() );
+					jabberMessage.setXHTMLBody ( message.escapedBody().replace("\n","") , QString::null, message.getHtmlStyleAttribute() );
+					// According to JEP-0071 
Comment 11 Olivier Goffart 2006-04-03 23:28:59 UTC
*** Bug 124853 has been marked as a duplicate of this bug. ***
Comment 12 Tobias Haf 2006-05-09 18:43:37 UTC
Hm, why this bug is marked as "resolved"? I updated to current-svn and the gaim-users still receive empty lines....
Comment 13 Thiago Macieira 2006-05-17 16:15:18 UTC
Tobias: are you using 0.11 or 0.12?
Comment 14 Tobias Haf 2006-05-17 16:18:51 UTC
I'm using 0.12svn.
Comment 15 Olivier Goffart 2006-06-10 15:30:03 UTC
The problem is that iris use internaly  QDomDocument::toString(0) which puts back the carriage returns for identation.
Comment 16 Matt Rogers 2006-06-13 03:09:36 UTC
can we fix iris to use something else then?
Comment 17 Michaël Larouche 2006-06-14 04:08:28 UTC
*** Bug 129120 has been marked as a duplicate of this bug. ***
Comment 18 rapsys 2006-06-14 04:40:02 UTC
Someone did report the bug on libgaim list ?
(as it seems more a bug in other jabber implementation, thant in kopete one, no ?)
Comment 19 Olivier Goffart 2006-08-01 00:54:13 UTC
I have reported to issue to Qt some times ago already
http://www.trolltech.com/developer/task-tracker/index_html?id=118388&method=entry
The solution will not be there before Qt4.2.  so we can hope it will be ok in KDE4
Comment 20 elsenator 2007-02-24 14:25:50 UTC
This issue has not yet ben fixed in 0.12.4. I'm having the issue while chatting with Gaim clients. A workaround is to disable rich text formatting.
Comment 21 Jaime Martin 2007-05-01 00:23:41 UTC
¿Is there any way to disable rich text by default in Jabber accounts?
Comment 22 Risto H. Kurppa 2007-05-17 10:51:51 UTC
Have the same problem here w. Kopete 0.12.4, KDE 3.5.6 7 Kubuntu Feisty. The recipient is using Gaim of Ubuntu Feisty. Still empty lines.

How do I disable rich text, I don't find the button to do it..  So if this is a gaim bug has it been reported there - could someone link here?
Comment 23 Risto H. Kurppa 2007-05-17 11:07:58 UTC
Pidgin (=gaim) report about this: http://developer.pidgin.im/ticket/277
Comment 24 S. Burmeister 2007-05-24 08:27:24 UTC
If it's really about Iris, how come Psi does not have this issue?
Comment 25 Olivier Goffart 2007-05-24 09:01:12 UTC
It's not about iris, but about Qt
And Psi doesn't have the issue because Psi doesn't support HTML editing
Comment 26 Pino Toscano 2007-05-26 14:18:43 UTC
*** Bug 145895 has been marked as a duplicate of this bug. ***
Comment 27 Guillermo Antonio Amaral Bastidas 2007-06-08 18:32:22 UTC
If anything is still considered a bug in this report I think it might have something to do with bug 140366.
Comment 28 Luigi Toscano 2007-10-01 16:31:59 UTC
*** This bug has been confirmed by popular vote. ***
Comment 29 mchugh19@yahoo.com 2008-11-15 17:20:16 UTC
Is this valid since the pidgin bug mention in comment 23 is fixed?
Comment 30 Bruno Bigras 2009-07-08 03:18:25 UTC
I can't reproduce this bug with Kopete 0.70.90 (KDE 4.2.95/Qt 4.5.1) and Pidgin 2.5.8.
Comment 31 Justin Zobel 2021-03-09 22:40:56 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.