This patch is a small bugfix for state affinity affecting the nowPlaying plugin 
engaging when a custom presence message is set. The custom message has to first 
be cleared to allow the mpris2 plugin to properly reset in the chooser and 
actually turn on in the kded plugin.
diff --git global-presence-chooser.cpp global-presence-chooser.cpp
index 2047473..dcc77fa 100644
--- global-presence-chooser.cpp
+++ global-presence-chooser.cpp
@@ -328,6 +328,10 @@ void GlobalPresenceChooser::onUserActivatedComboChange(int index)
 
         bool pluginEnabled = kdedConfig.readEntry("nowPlayingEnabled", false);
 
+        //empty the status message to avoid custom status messages clogging the stack  
+        Tp::SimplePresence presence;
+        presence.type = m_globalPresence->requestedPresence().type();
+        presence.status = m_globalPresence->requestedPresence().status();
         if (!pluginEnabled) {
             if (KMessageBox::questionYesNo(this,
                 i18n("This plugin is currently disabled. Do you want to enable it and use as your presence?"),
@@ -350,6 +354,7 @@ void GlobalPresenceChooser::onUserActivatedComboChange(int index)
                                                           QLatin1String( "org.kde.Telepathy"),
                                                           QLatin1String("activateNowPlaying"));
         QDBusConnection::sessionBus().send(message);
+        m_globalPresence->setPresence(presence);
     } else if (m_modelExtended->temporaryPresence().isValid() && index == count()-3)
     {
         //do nothing if the temporary presence is selected. This is only used for externally set presences.
_______________________________________________
KDE-Telepathy mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-telepathy

Reply via email to