Yahoo add buddy - Add request pending

Duncan Berriman duncan at dcl.co.uk
Mon Jun 27 08:22:15 EDT 2011


I'm having a slight issue with Yahoo (on 2.7.8 and 2.9) 

I have some of my own software which uses libpurple.

When I add a yahoo buddy via my software the real yahoo client gets the
buddy request which I accept, yahoo then unusually sends an authorisation
request to the originator (google, msn and aim don't do this and work fine).

My libpurple software receives the buddy authorisation request (after the
yahoo im client buddy accepts) which is accepted and the buddy added to the
account by my software automatically as can be seen from the log below - in
fact it should already be a buddy and on the account.

Mon Jun 27 11:47:11 2011 Buddy "test20110627" (prpl-yahoo) signed on
Mon Jun 27 11:47:11 2011 Buddy authorization request accepted from
"test20110627" (prpl-yahoo): (null)

This is done as follows:-

static void *request_authorize(PurpleAccount *account, const char
*remote_user, const char *id, const char *alias, const char *messagetext,
gboolean on_list, PurpleAccountRequestAuthorizationCb authorize_cb,
PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
{
	PurpleBuddy *buddy = purple_find_buddy(account,remote_user);
	if (buddy != NULL) {
		sprintf(message,"Buddy authorization request accepted from
\"%s\" (%s): %s", remote_user, purple_account_get_protocol_id(account),
messagetext);
		reportlog(message);
		authorize_cb(user_data);
	}
	else {
		sprintf(message,"Buddy authorization request rejected from
\"%s\" (%s): %s", remote_user, purple_account_get_protocol_id(account),
messagetext);
		reportlog(message);
		deny_cb(user_data);
	}
}

The status on the real Yahoo im client after accepting the buddy request
stays as add request pending although messages can be sent both ways.

I have to close down my libpurple software and restart it, when it logs into
yahoo it gets another buddy authorization request through which my software
accepts automatically again by the same method and the yahoo service updates
correctly as can be seen below.

Mon Jun 27 11:49:12 2011 Buddy authorization request accepted from
"test20110627" (prpl-yahoo): (null)
Mon Jun 27 11:49:12 2011 Buddy "test20110627" (prpl-yahoo) signed on

Not sure why this does not work until I restart my libpurple software.

Tried a number of times  with same results. 

Any ideas?

Finch appears to work fine, so I'm sure this is issue is in my code but not
sure what I am doing wrong.

Thanks
Duncan




More information about the Devel mailing list