From f815711d039485259835e246103d3e7f8f3d7203 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 7 Sep 2010 21:56:26 +0000 Subject: * Batch 1/2 of kdemultimedia bugfix patches from the Chakra project git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1172709 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/jabber/jabberchatsession.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'kopete/protocols/jabber') diff --git a/kopete/protocols/jabber/jabberchatsession.cpp b/kopete/protocols/jabber/jabberchatsession.cpp index e07582f7..dbe35ab6 100644 --- a/kopete/protocols/jabber/jabberchatsession.cpp +++ b/kopete/protocols/jabber/jabberchatsession.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -278,25 +279,28 @@ void JabberChatSession::slotMessageSent ( Kopete::Message &message, Kopete::Chat { // this message is not encrypted jabberMessage.setBody ( message.plainBody ()); - if (message.format() == Kopete::Message::RichText) + if (message.format() == Kopete::Message::RichText) { JabberResource *bestResource = account()->resourcePool()->bestJabberResource(toJid); if( bestResource && bestResource->features().canXHTML() ) { TQString xhtmlBody = message.escapedBody(); - + // According to JEP-0071 8.9 it is only RECOMMANDED to replace \n with
- // which mean that some implementation (gaim 2 beta) may still think that \n are linebreak. + // which mean that some implementation (gaim 2 beta) may still think that \n are linebreak. // and considered the fact that KTextEditor generate a well indented XHTML, we need to remove all \n from it // see Bug 121627 // Anyway, theses client that do like that are *WRONG* considreded the example of jep-71 where there are lot of // linebreak that are not interpreted. - Olivier 2006-31-03 xhtmlBody.replace("\n",""); - + //  is not a valid XML entity xhtmlBody.replace(" " , " "); - - xhtmlBody="

"+ xhtmlBody +"

"; + + // Remove trailing line break + xhtmlBody.remove( TQRegExp( "
$" ) ); + + xhtmlBody = "" + xhtmlBody + ""; jabberMessage.setXHTMLBody ( xhtmlBody ); } } @@ -310,11 +314,11 @@ void JabberChatSession::slotMessageSent ( Kopete::Message &message, Kopete::Chat // FIXME: the view() is a speedy way to solve BUG:108389. A better solution is to be found // but I don't want to introduce a new bug during the bug hunt ;-). if (view() && view()->plugin()->pluginId() == "kopete_emailwindow" ) - { + { jabberMessage.setType ( "normal" ); } else - { + { jabberMessage.setType ( "chat" ); } -- cgit v1.2.1