Summary: | Preserve multiple whitespaces and whitespaces at the beginning of line | ||
---|---|---|---|
Product: | [Unmaintained] kopete | Reporter: | Dmitry <dmitry.risenberg> |
Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | wishlist | CC: | dmitry.risenberg, igor.poboiko, meyerm, mystra.x64 |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch to bug #224091
Updated patch to bug 224091 Updated patch to bug 224091 |
Description
Dmitry
2010-01-24 22:21:23 UTC
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. |