libpurple buddy add issues with msn

Duncan Berriman duncan at dcl.co.uk
Sun Dec 19 12:32:06 EST 2010


Hi Elliott/list,

I finally figured the request ui after some digging through the protocol sources and added it to my code.

I can now see the request in my code but unsure how to handle the call back correctly.

If I use use ok_cb() as below then the code access violates, done a lot of playing and digging but I can't figure away to tell the callback to continue and call finish_auth_request.

static void *pidgin_request_input(const char *title, const char *primary,
                                           const char *secondary, const char *default_value,
                                           gboolean multiline, gboolean masked, gchar *hint,
                                           const char *ok_text, GCallback ok_cb,
                                           const char *cancel_text, GCallback cancel_cb,
                                           PurpleAccount *account, const char *who, PurpleConversation *conv,
                                           void *user_data)
{
	printf("Request input title: %s primary: %s secondary: %s default :%s\n", title, primary, secondary, default_value);
	ok_cb();
}

Bit out of my depth here as you might have guessed!

Any help greatly appreciated.
Thanks
Duncan

-----Original Message-----
From: devel-bounces at pidgin.im [mailto:devel-bounces at pidgin.im] On Behalf Of Duncan Berriman
Sent: 18 December 2010 11:50
To: Elliott Sales de Andrade
Cc: devel at pidgin.im
Subject: Re: libpurple buddy add issues with msn

Hi Elliott,

OK I've added the following

static PurpleAccountUiOps account_uiops = {
     notify_added,              /* notify_added          */
     status_changed,            /* status_changed        */
     request_add,               /* request_add           */
     request_authorize,         /* request_authorize     */
     NULL,                      /* close_account_request */
     NULL,
     NULL,
     NULL,
     NULL
}

I know status_changed and request_authorize are working. I can see the status changes in my log and an incoming request is accepted/rejected as required.

However whatever I do an incoming or outgoing buddy still isn't added to my msn account.

notify_added and request_add do not appear to be called. All I am doing in them is displaying a message which does not get called.

buddy = purple_buddy_new(account,"buddy at hotmail.com",NULL);
purple_blist_add_buddy(buddy, NULL, NULL, NULL); purple_account_add_buddy(account,buddy);

Guess I need to look at the differences between the gtalk and msn code to understand what is going on under the bonnet. I'm clearly not understanding something here.

Thanks for your help.
Duncan

On 18/12/2010 01:06, Elliott Sales de Andrade wrote:
> On Fri, Dec 17, 2010 at 7:11 PM, Duncan Berriman<duncan at dcl.co.uk>  wrote:
>> Hi Elliott,
>>
>> Thanks for that but must say I am a little confused but I am new to 
>> this (just a couple of days). I have a command line client that is 
>> working save for this functionality. If I can get msn buddies to work 
>> then I am pretty much finished apart from testing it to death.
>>
>> As I have no gui in my client and there is no one to answer an 
>> interactive question. I can't see a signal handler in the request api 
>> so not sure how I can proceed, unless I can use the request uiops in some way.
>>
> Yes, you need to implement the request uiops. It will unfortunately be 
> a bit of a hack. We can't really change the API until 3.0.
>
>> I'll look at the source for the msn prpl but surely its up to the 
>> client program/programmer to ask questions rather than the underlying 
>> protocol handler.
>>
> The uiops tell the UI to ask the user a question.
>
>> I'd have thought by the program saying 'purple_account_add_buddy' it 
>> would be implicit I wanted it to send an invite as it is with google 
>> but I guess not.
>>
> GTalk has invite requests, but no invite messages.
>
>> Is there any simple way round this?
>>
>> Thanks for your help. Much appreciated.
>> Duncan
>>
>> On 17/12/2010 22:52, Elliott Sales de Andrade wrote:
>>>   On Fri, Dec 17, 2010 at 2:42 PM, Duncan Berriman<duncan at dcl.co.uk>
>>> wrote:
>>>>   Hi,
>>>>
>>>>   I am trying to add a buddy using libpurple with msn.
>>>>
>>>>   I’m doing the following to add a new buddy….
>>>>
>>>>                  buddy =
>>>> purple_buddy_new(account,"buddy at hotmail.com",NULL);
>>>>                  purple_blist_add_buddy(buddy, NULL, NULL, NULL);
>>>>                  purple_account_add_buddy(account,buddy);
>>>>
>>>>   code works fine with googletalk but on msn the buddy never receives the
>>>>   request and the buddy is not added to the msn buddy list.
>>>>
>>>>   Using version 2.7.7 on centos 5.5
>>>>
>>>>   Any ideas why this is not working as I’m stumped. I’ve even 
>>>> created a brand
>>>>   new msn account for my client to connect and the only thing it 
>>>> has attempted
>>>>   to do is sign on (with success) and add a buddy (seemingly with 
>>>> success but
>>>>   nothing happens). As I mentioned above same code with google works first
>>>>   time.
>>>>
>>>   The MSN prpl pops up a request for the invite message. You would see
>>>   the same thing on an Oscar account (AIM/ICQ). You need to implement
>>>   the request API.
>>>
>>>>   Thanks
>>>>   Duncan
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at pidgin.im
>> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>>
>
>

_______________________________________________
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