Fix html special chars in kopete nowlistening plugin

This partially resolves Bug 994
pull/1/head
Slávek Banko 12 years ago
parent e38ab8d805
commit 2d699f5239

@ -20,6 +20,7 @@
#include <tqtimer.h> #include <tqtimer.h>
#include <tqstringlist.h> #include <tqstringlist.h>
#include <tqstylesheet.h>
#include <tqregexp.h> #include <tqregexp.h>
#include <kdebug.h> #include <kdebug.h>
@ -189,7 +190,7 @@ void NowListeningPlugin::slotOutgoingMessage(Kopete::Message& msg)
if(!NowListeningConfig::self()->chatAdvertising()) if(!NowListeningConfig::self()->chatAdvertising())
return; return;
TQString originalBody = msg.plainBody(); TQString originalBody = msg.escapedBody();
// If it is a /media message, don't process it // If it is a /media message, don't process it
if(originalBody.startsWith(NowListeningConfig::self()->header())) if(originalBody.startsWith(NowListeningConfig::self()->header()))
@ -222,7 +223,7 @@ void NowListeningPlugin::slotOutgoingMessage(Kopete::Message& msg)
{ {
TQString advert = mediaPlayerAdvert(false); // false since newTrackPlaying() did the update TQString advert = mediaPlayerAdvert(false); // false since newTrackPlaying() did the update
if( !advert.isEmpty() ) if( !advert.isEmpty() )
newBody = originalBody + "<br>" + advert; newBody = originalBody + "<br>" + TQStyleSheet::escape(advert);
// If we send because the information has changed since it was last sent, we must // If we send because the information has changed since it was last sent, we must
// rebuild the list of contacts the latest information was sent to. // rebuild the list of contacts the latest information was sent to.
@ -501,7 +502,7 @@ void NowListeningPlugin::advertiseToChat( Kopete::ChatSession *theChat, TQString
pl, pl,
message, message,
Kopete::Message::Outbound, Kopete::Message::Outbound,
Kopete::Message::RichText ); Kopete::Message::PlainText );
theChat->sendMessage( msg ); theChat->sendMessage( msg );
} }

Loading…
Cancel
Save