Exclusive Status Messages

Ka-Hing Cheung khc at hxbc.us
Tue Jul 1 22:55:30 EDT 2008


On Tue, 2008-07-01 at 22:30 -0400, Kyle wrote:
> 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 think you need to call purple_change_account_status here.

-khc





More information about the Devel mailing list