libpurple / Friendly name

Mark Doliner mark at kingant.net
Fri Dec 4 03:07:26 EST 2009


Hi Cedric.  I imagine you've either already figured this out or given up, but...

You can look at how Pidgin implements the request_input callback as an
example.  Basically you'll need to call
ok_cb(user_data, "My Friendly Name");, and you may want to do that
after a 0 second timer (to return control back to the mainloop in case
MSN or some other code wants to finish something before the ok cb is
triggered.  This happens in pidgin/gtkrequest.c in the functions
pidgin_request_input() and input_response_cb().

-Mark

On Mon, Sep 28, 2009 at 3:35 AM, Cedric Roche <csced at hotmail.com> wrote:
> Hi,
>
> I'm still trying to change the friendly name. What do I have to do in the
> PurpleRequestUiOps->request_input callback or elsewhere to change that name
> ?
> I still don't understand how to use the "Set Friendly Name..." action.
>
> Thx
>
>> Date: Wed, 9 Sep 2009 07:21:37 -0700
>> Subject: Re: libpurple / Friendly name
>> From: mark at kingant.net
>> To: csced at hotmail.com
>> CC: pidgin at unreliablesource.net; devel at pidgin.im
>>
>> Hmm, that's strange. Have you implemented a callback function for
>> PurpleRequestUiOps->request_input?
>>
>> Yes, I believe this is the only way to set your MSN friendly name.
>> Yes, it is not ideal. We should probably add a "set_nickname" or
>> "set_my_nickname" function or something to PurplePluginProtocolInfo.
>>
>> -Mark
>>
>> On Wed, Sep 9, 2009 at 5:10 AM, Cedric Roche<csced at hotmail.com> wrote:
>> > My program don't get prompted.
>> > So you are saying that there is no way to just call the callback and
>> > give
>> > the Friendly name I want to use ?
>> >
>> > How don't see how that must be done in my code.
>> >
>> >
>> > Thx
>> > Cedric
>> >
>> >> Date: Tue, 8 Sep 2009 10:21:00 -0700
>> >> Subject: Re: libpurple / Friendly name
>> >> From: mark at kingant.net
>> >> To: csced at hotmail.com
>> >> CC: pidgin at unreliablesource.net; devel at pidgin.im
>> >>
>> >> Calling this function causes the MSN protocol plugin to call
>> >> purple_request_input() to prompt the user to enter the friendly name
>> >> to use. You can either show that request to the user and have them
>> >> respond to it, or you can intercept it and call the appropriate
>> >> callback function in your UI-specific request code (if you do this,
>> >> you should probably call the function from a timeout or idle
>> >> callback).
>> >>
>> >> -Mark
>> >>
>> >> On Tue, Sep 8, 2009 at 5:14 AM, Cedric Roche<csced at hotmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > Thanks for the answer.
>> >> >
>> >> > Yes that's exactly what I did. Here is my code :
>> >> >
>> >> > GList *actions;
>> >> >
>> >> > GList *l;
>> >> >
>> >> > PurplePluginAction *action = NULL;
>> >> >
>> >> > actions = PURPLE_PLUGIN_ACTIONS(p, NULL);
>> >> >
>> >> > for (l = actions; l != NULL; l = l->next)
>> >> >
>> >> > {
>> >> >
>> >> > if (l->data)
>> >> >
>> >> > {
>> >> >
>> >> > action = (PurplePluginAction *) l->data;
>> >> >
>> >> > if ((strcmp(action->label, "Set Friendly Name...")) == 0)
>> >> >
>> >> > {
>> >> >
>> >> > action->callback(action);
>> >> >
>> >> > }
>> >> >
>> >> > }
>> >> >
>> >> > }
>> >> >
>> >> > If this is the good way to change the friendly name, how can I pass
>> >> > the
>> >> > name
>> >> > to the function ?
>> >> >
>> >> >
>> >> > Thx
>> >> >
>> >> >
>> >> >> Date: Mon, 7 Sep 2009 17:55:32 -0700
>> >> >> Subject: Re: libpurple / Friendly name
>> >> >> From: mark at kingant.net
>> >> >> To: csced at hotmail.com
>> >> >> CC: pidgin at unreliablesource.net; devel at pidgin.im
>> >> >>
>> >> >> I think this email might help you:
>> >> >> http://pidgin.im/pipermail/devel/2009-March/007833.html
>> >> >>
>> >> >> It discusses MySpace's import friends function and not MSN's set
>> >> >> friendly name function, but both functions are exposed to libpurple
>> >> >> in
>> >> >> the same manner.
>> >> >>
>> >> >> -Mark
>> >> >>
>> >> >> On Mon, Sep 7, 2009 at 4:17 AM, Cedric Roche<csced at hotmail.com>
>> >> >> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > I found the "Set Friendly Name..." callback function, but I don't
>> >> >> > know I
>> >> >> > to
>> >> >> > use it...
>> >> >> > I looked in the pidgin source and tried different stuff that don't
>> >> >> > work.
>> >> >> >
>> >> >> > How exactly must the function be called ?
>> >> >> >
>> >> >> > Thx
>> >> >> >
>> >> >> > Cedric
>> >> >> >
>> >> >> >> Date: Thu, 13 Aug 2009 20:42:39 -0400
>> >> >> >> From: pidgin at unreliablesource.net
>> >> >> >> To: csced at hotmail.com
>> >> >> >> CC: devel at pidgin.im
>> >> >> >> Subject: Re: libpurple / Friendly name
>> >> >> >>
>> >> >> >> On Thu, Aug 13, 2009 at 11:39:52AM +0200, Cedric Roche wrote:
>> >> >> >> >
>> >> >> >> > Hi,
>> >> >> >> >
>> >> >> >> > I'm looking for the method that changes the account friendly
>> >> >> >> > name
>> >> >> >> > /
>> >> >> >> > alias. I don't find it in the account API.
>> >> >> >> >
>> >> >> >> > Thx
>> >> >> >>
>> >> >> >> It isn't in the account API, it is functionality exposed from the
>> >> >> >> MSN
>> >> >> >> prpl
>> >> >> >> as an account action via PURPLE_PLUGIN_ACTIONS.
>> >> >> >>
>> >> >> >> -Etan
>> >
>> > ________________________________
>> > Vous cherchez l'intégrale des clips de Michael Jackson ? Bing ! Trouvez
>> > !
>
> ________________________________
> Découvrez toutes les possibilités de communication avec vos proches




More information about the Devel mailing list