Exclusive Status Messages

Kyle robo210 at gmail.com
Tue Jul 1 22:30:50 EDT 2008


Hello,
I am in the process of writing (yet another) plugin that will set your 
status message to the current playing song. I would like to utilize the 
tune status that Jabber supports, however, nothing seems to happen. 
Right now my code looks as follows:

for (account_list = purple_accounts_get_all_active(); account_list != 
NULL; account_list = account_list->next) {
         account = (PurpleAccount*)account_list->data;
         presence = purple_account_get_presence(account);
         status_tune = purple_presence_get_status(presence, 
purple_primitive_get_id_from_type(PURPLE_STATUS_TUNE));
         if(status_tune != NULL) {
             purple_debug_warning(PLUGIN_ID, "Set tune\n");
             purple_status_set_attr_string(status_tune, 
PURPLE_TUNE_TITLE, title->str);
             purple_status_set_attr_string(status_tune, 
PURPLE_TUNE_ARTIST, artist->str);
             //purple_account_set_status(account, "tune", TRUE, NULL);
             purple_presence_set_status_active(presence, 
purple_status_get_id(status_tune), TRUE);
         }
     }

I feel like there must be something missing from this that will activate 
the status properly, however, I can not find it.
The full source code to this plugin can be found here:
http://www.kylesabo.com/musis.tar.bz2
in case anyone needs to compile it to figure out what is happening. It 
should compile under Linux just fine and under Windows only with the 
iTunes SDK and DispEx.h from the Windows Platform SDK and the included 
makefile (make -f z.mingw music.dll).

Thank you,
Kyle Sabo




More information about the Devel mailing list