From 0486034738b850c210b1389a8c3ae51a6b9fad23 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 29 Mar 2014 00:54:51 +0900 Subject: Removed MSN support across Kopete by removing the MSN protocol and the netmeeting plugin. This resolves bug 1547. --- kopete/plugins/nowlistening/nowlisteningplugin.cpp | 108 ++++++--------------- 1 file changed, 30 insertions(+), 78 deletions(-) (limited to 'kopete/plugins/nowlistening') diff --git a/kopete/plugins/nowlistening/nowlisteningplugin.cpp b/kopete/plugins/nowlistening/nowlisteningplugin.cpp index 6fcc21cd..31284446 100644 --- a/kopete/plugins/nowlistening/nowlisteningplugin.cpp +++ b/kopete/plugins/nowlistening/nowlisteningplugin.cpp @@ -258,84 +258,36 @@ void NowListeningPlugin::slotAdvertCurrentMusic() TQPtrList accountsList = Kopete::AccountManager::self()->accounts(); for( Kopete::Account* a = accountsList.first(); a; a = accountsList.next() ) { - /* - NOTE: - MSN status message(personal message) use a special tag to advert the current music playing. - So, we don't send the all formatted string, send a special string seperated by ";". - - Also, do not use MSN hack in appending mode. - */ - if( a->protocol()->pluginId() == "MSNProtocol" && !NowListeningConfig::self()->appendStatusAdvertising() ) - { - TQString track, artist, album, mediaList; - bool isPlaying=false; - - if( NowListeningConfig::self()->useSpecifiedMediaPlayer() && d->m_currentMediaPlayer ) - { - if( d->m_currentMediaPlayer->playing() ) - { - track = d->m_currentMediaPlayer->track(); - artist = d->m_currentMediaPlayer->artist(); - album = d->m_currentMediaPlayer->album(); - mediaList = track + ";" + artist + ";" + album; - isPlaying = true; - } - } - else - { - for ( NLMediaPlayer* i = d->m_mediaPlayerList.first(); i; i = d->m_mediaPlayerList.next() ) - { - if( i->playing() ) - { - track = i->track(); - artist = i->artist(); - album = i->album(); - mediaList = track + ";" + artist + ";" + album; - isPlaying = true; - } - } - } - - // KDE4 TODO: Use the new status message framework, and remove this "hack". - if( isPlaying ) - { - advert = TQString("[Music]%1").arg(mediaList); - } - - } - else - { - if( NowListeningConfig::self()->appendStatusAdvertising() ) - { - // Check for the now listening message in parenthesis, - // include the header to not override other messages in parenthesis. - TQRegExp statusSong( TQString(" \\(%1.*\\)$").arg( NowListeningConfig::header()) ); - - // HACK: Don't keep appending the now listened song. Replace it in the status message. - advert = a->myself()->property( Kopete::Global::Properties::self()->awayMessage() ).value().toString(); - // Remove the braces when they are no listened song. - TQString mediaAdvert = mediaPlayerAdvert(false); - if(!mediaAdvert.isEmpty()) - { - if(statusSong.search(advert) != -1) - { - advert = advert.replace(statusSong, TQString(" (%1)").arg(mediaPlayerAdvert(false)) ); - } - else - { - advert += TQString(" (%1)").arg( mediaPlayerAdvert(false) ); - } - } - else - { - advert = advert.replace(statusSong, ""); - } - } - else - { - advert = mediaPlayerAdvert(false); // newTrackPlaying has done the update. - } - } + if( NowListeningConfig::self()->appendStatusAdvertising() ) + { + // Check for the now listening message in parenthesis, + // include the header to not override other messages in parenthesis. + TQRegExp statusSong( TQString(" \\(%1.*\\)$").arg( NowListeningConfig::header()) ); + + // HACK: Don't keep appending the now listened song. Replace it in the status message. + advert = a->myself()->property( Kopete::Global::Properties::self()->awayMessage() ).value().toString(); + // Remove the braces when they are no listened song. + TQString mediaAdvert = mediaPlayerAdvert(false); + if(!mediaAdvert.isEmpty()) + { + if(statusSong.search(advert) != -1) + { + advert = advert.replace(statusSong, TQString(" (%1)").arg(mediaPlayerAdvert(false)) ); + } + else + { + advert += TQString(" (%1)").arg( mediaPlayerAdvert(false) ); + } + } + else + { + advert = advert.replace(statusSong, ""); + } + } + else + { + advert = mediaPlayerAdvert(false); // newTrackPlaying has done the update. + } a->setOnlineStatus(a->myself()->onlineStatus(), advert); } -- cgit v1.2.1