After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612714 - IM Status plugin does not reset status message on end playback
IM Status plugin does not reset status message on end playback
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-12 16:24 UTC by Hussam Al-Tayeb
Modified: 2010-04-18 04:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Return empty string instead of None from set_mc5_status (473 bytes, patch)
2010-04-08 18:34 UTC, Jason
none Details | Review

Description Hussam Al-Tayeb 2010-03-12 16:24:44 UTC
Imstatus plugin sents the current playing song to appear in pidgin status. if I stop the song, it correctly disappears from pidgin status.
but if I close rhythmbox without stoping the song first, the plugin does not remove the playing song from pidgin status.
pidgin will now cache the status message because rhythmbox didn't tell it the it's not playing the song anymore. eventually, pidgin will cache too many status messages and this gets annoying.
Can imstatus plugin tell pidgin that the song stopped playing when I shut down rhythmbox?
Comment 1 Matt N 2010-03-13 21:43:30 UTC
I just tested this with git HEAD, and checked the code.  For me it does remove the status when I close rhythmbox.

the relevant lines from plugins/im-status/im-status/__init__.py:

  def deactivate (self, shell):
    self.shell = None
    sp = shell.get_player ()
    sp.disconnect (self.psc_id)
    sp.disconnect (self.pc_id)
    sp.disconnect (self.pspc_id)

    if self.current_entry is not None:
      self.restore_status ()
Comment 2 Jason 2010-04-08 17:27:01 UTC
I agree with 'Matt N'. This does work for Pidgin but it does not work for Empathy...

as reported here: https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/551217
Comment 3 Jason 2010-04-08 18:34:45 UTC
Created attachment 158225 [details] [review]
Return empty string instead of None from set_mc5_status

The problem seems to be this:

----------------------------------
def get_mc5_status (self):
...
    for acct in am.Get (MC5_AM_IFACE_NAME, "ValidAccounts"):
        ...
        if status[2] != "":
              return status[2]
    ....
    return None
----------------------------------

This algorithm is doing the following:

Loop through all empathy accounts. 
If the status of the current account is not an empty string then return it and save it so we can restore it later.
If we do not find an account with a status that is not an empty string then simply return None.

the None value is implicitly used by this plugin to mean that we never saved the status in the first place, so we never bother restoring it.

Here is the kicker:  Empathy (MC5, rather) uses an empty string as the default status message. Even though the user is seeing the status as "Available"... status[2] is actually an empty string.

The proper fix seems to be to change the return statement to return an empty string instead of None.
Comment 4 Hussam Al-Tayeb 2010-04-08 19:38:40 UTC
I can still reproduce this with pidgin using latest rhythmbox from git (I love the new icons btw).
Comment 5 Jason 2010-04-09 01:02:20 UTC
Hussam,

Is there is a specific set of steps I can follow to reproduce this? I've tried on two separate computers and I cannot reproduce this. I start Rhythmbox, I start playing a song, then I quit Rhythmbox and my Pidgin status is set back to what it was before I started playing the song.

How are you closing Rhythmbox? Are you starting it from the command line and then pressing Ctrl+C?  If I close it that way I CAN reproduce this. But I would not consider that a bug because Ctrl+C basically force quits the program without giving it a chance to clean up..

Is it possible Rhythmbox is crashing when you click close? Try running it from a terminal to be sure.

How are you closing it? Are you clicking the 'X' at the top of the window? If so, are you sure that the program is closing? It may simply disappear into the "notification area".. look for a Rhythmbox icon in the panel next to your pidgin notification icon.

Another thought, when you build the latest Rhythmbox from git to you actually install it or just run the executable from the source dir? If you run from the source dir then you are probably still using the old plugins as Rhythmbox will always look in /usr/lib/rhythmbox/plugins for the plugins even if you are running from the source directory.

I do apologize in advance if by making any of these suggestions I sound like I am insulting your intelligence. I just want to be clear and make sure we've thought of everything :)
Comment 6 Hussam Al-Tayeb 2010-04-09 01:29:04 UTC
no, I'm installing it to /usr

Ok, I got it. My problem is a pidgin issue and not a rhythmbox bug. when I change my status from 'online' to 'away' (which I do often), the 'online' status message gets cached/saved. Then when I close rhythbox, the away status message gets removed (as expected) but the initial 'online' status message is still cached.
So yes, not a rhythmbox bug.
so to reproduce:
1. play a song and it appears in 'online' status message.
2. change online to away. song name is cached in an online status message.
3. The away status message now shows the playing song.
4. quit rhythmbox and the song is correctly removed from 'away' status message.
Comment 7 Jonathan Matthew 2010-04-18 04:18:45 UTC
fixed in commit d2ca8e6