Yahoo add buddy - Add request pending

Duncan Berriman duncan at dcl.co.uk
Tue Jun 28 09:17:20 EDT 2011


Hi All,

I've done some more research and testing on this and can not figure out what
is wrong, despite looking at source code for other projects such as finch.

The only way I can work round this issue at the moment is to get my program
to disconnect the yahoo session after the authorize_cb is called.

My program automatically reconnects a few seconds later and gets a 2nd
request for authorization from yahoo which it accepts by the same method and
disconnects again.

When it then reconnects automatically again all is ok and the contact is
authorized.

So it doesn't appear to be something to do with my program as such, or at
least not to do with restarting it, for some reason the first authorization
attempt/callback fails or disconnect/connecting the session causes something
(the buddy list?) to be reloaded which means the callback works.

Any ideas why ? Bit stumped now.

Thanks
Duncan

> -----Original Message-----
> From: devel-bounces at pidgin.im [mailto:devel-bounces at pidgin.im] On
> Behalf Of Duncan Berriman
> Sent: 27 June 2011 13:22
> To: 'Pidgin Devel Mailing List'
> Subject: Yahoo add buddy - Add request pending
> 
> 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
> 
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
> 
> --
> This message has been scanned for viruses and dangerous content by
> MailScanner, and is believed to be clean.




More information about the Devel mailing list