Version: (using KDE 4.3.4) OS: Linux Installed from: Debian testing/unstable Packages I would like Kopete to send whitespaces ind messages 'as is' and not to trim them. Current behaviour is: ' line' is sent as 'line' 'white space' is sent as 'white space' The expected behaviour is: ' line' is sent as ' line' 'white space' is sent as 'white space' It may be not the default behaviour, but be enabled/disabled by a setting.
I can confirm it. Same there when I'm receiving a message with extra whitespaces, and it really annoys me.
*** This bug has been confirmed by popular vote. ***
Created attachment 43418 [details] patch to bug #224091
First of all, sorry for my bad english, but I hope you will understand all what I tried to say :) Kopete uses HTML in chat window. In HTML many whitespaces displays like one whitespace, so Kopete doesn't display it correctly. Possible fix is to add tag <PRE> to all displaying messages, or to add 'white-space: pre' to default CSS. After fixing first problem, Jabber (I tested on it) sends and receives messages with multiple whitespaces with no problems. Second problem is in Oscar protocol. The message (I have entered) before sending is being formatted to some HTML format. Kopete use QTextDocument::setHtml(), and it trims all multiple whitespaces. Possible fix is to call QTextDocument::setDefaultStyleSheet() with parameter '* { white-space: pre; }' like in first part of this problem. After fixing it, whitespaces are not ignored in my Oscar messages. Third problem is history plugin. In logs ($HOME/.kde4/share/apps/kopete/logs) messages stores with whitespaces, but kopete displays it without it. Same problem here - history plugin calls Kopete::Message::setHtmlBody() (plugins/history/historylogger.cpp, lines 611 and 618), which calls QTextDocument::setHtml(), which trims all whitespaces. Possible fix is same - just call setDefaultStyleSheet(), but I don't know where to do it - in history plugin I can't call this method of Kopete::Message's QTextDocument because of incapsulation (or can? I can be wrong..) And see attached patch:)
Ok, I think the right way to fix problem with history plugin is to call setDefaultStyleSheet in Kopete::Message::Private constructor (which has QTextDocument field). See attached patch.
Created attachment 43423 [details] Updated patch to bug 224091
Created attachment 43425 [details] Updated patch to bug 224091 It is definitely bad idea to set 'white-space: pre;' to ALL HTML tags in chat-window CSS; we need to do it only for KopeteMessageBody.
Use white-space: pre-wrap; for message text instead. However file transfer message HTML code goes into message too. So... it must _not_ contain line breaks (currently it does) or at least there should be a class (class="transfer-block" or similar) for this to reset white-space to normal for it.
*** Bug 262320 has been marked as a duplicate of this bug. ***
Dear user, unfortunately Kopete is no longer maintained. Please migrate to another solution, e.g. for Jabber a possibility is Kaidan, for Matrix a candidate is NeoChat.