Exclusive Status Messages
Ka-Hing Cheung
khc at hxbc.us
Wed Jul 2 00:54:24 EDT 2008
On Wed, 2008-07-02 at 00:15 -0400, Kyle wrote:
> Ka-Hing Cheung wrote:
> > 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
>
> Calling purple_prpl_change_account_status seems to have no effect, even
> with varying values for the old status (the current active status, null,
> the same status as I want to set). Other functions I have tried are:
> purple_presence_set_status_active(presence,purple_status_get_id(status_tune),TRUE);
> purple_account_set_status(account,purple_status_get_id(status_tune),TRUE,PURPLE_TUNE_TITLE,title->str,PURPLE_TUNE_ARTIST,artist->str,NULL);
> purple_presence_switch_status(presence,purple_status_get_id(status_tune));
> purple_prpl_change_account_status(account,purple_presence_get_active_status(presence),status_tune);
>
> All of these seemed to do nothing. Could it be that you can not see your
> own tune status, or am I still missing something?
purple_prpl_change_account_status works for me. but you are right, you
cannot see your own tune status. If you want to fix that, see
jabber_presence_fake_to_self().
Also make sure that your jabber server supports PEP.
-khc
More information about the Devel
mailing list