purple_blist_add_buddy() and purple_account_add_buddy() inconsistency

Mark Doliner mark at kingant.net
Tue Jun 26 02:54:19 EDT 2007


On Mon, 25 Jun 2007 13:55:31 -0400, John Bailey wrote
> Such is not the case on AIM, however.  The behavior I see here is 
> that the buddies appear in the Pidgin blist but always have an 
> offline status, even though I know at least four of these people are 
> online.  Looking at blist.xml after the next shown flush in the 
> debug window shows that nothing has been added to the local list.  
> The alias and buddy notes are not added, either.  The status remains 
> incorrect until I restart Pidgin, disable and enable the account, or 
> switch to the offline status and then back to an online status.  At 
> this point, the buddies are finally shown in blist.xml and statuses 
> are correct; however, the alias and notes string that were set at 
> import are missing.  Behavior is identical on ICQ when importing a 
> list of AIM buddies (which to my limited knowledge does not require 
> authorization).
> 
> It seems to me that all the prpls should behave consistently when 
> buddies are added.  How should this work though?  Should I be losing 
> the alias and notes that I've tried to set on the buddy or should 
> oscar and other prpls not behaving like Yahoo! be made to behave 
> correctly, as Yahoo! does?

I agree, it seems like all the prpls should behave consistently.  You probably
should not be losing the alias and notes.

> Here is the code in question, sans comment and purple_debug_info 
> calls for clarity:
> 
> void lh_util_add_buddy(const gchar *group, PurpleGroup *purple_group,
>  const gchar *buddy, const gchar *alias, PurpleAccount *account, 
> const gchar *buddynotes) { 	PurpleBuddy *purple_buddy = 
> purple_buddy_new(account, buddy, alias); 
> 	purple_blist_add_buddy(purple_buddy, NULL, purple_group, NULL); 
> 	purple_account_add_buddy(account, purple_buddy);
> 
> 	if(buddynotes)
> 		purple_blist_node_set_string((PurpleBlistNode *)purple_buddy,
>  "notes", buddynotes); }

This looks like exactly what add_buddy_cb in pidgin/gtkblist.c does.  I don't
understand why the oscar buddies wouldn't show up as online.  And I don't
understand why disabling/enabling the account would fix it.  Are the buddies
getting added to the server correctly (you should see some "ssi" lines in the
debug window)?  Do you actually receive presence for those buddies (you might
see some "Updating buddy status" lines in the debug log)?

-Mark




More information about the Devel mailing list