libpurple MSN change display name

Mark Doliner mark at kingant.net
Sun Mar 28 03:46:24 EDT 2010


On Thu, Feb 25, 2010 at 2:39 AM, Hij Bogdan <bogdan_hij at yahoo.com> wrote:
> Hello guys,
>
> Using libpurple 2.6.3 on a  Gentoo x64 machine.
>
> I am trying to change display name(friendly name) with
> purple_connection_set_display_name() function but with no efect.
> I can see that this function is not enough to do this.
> How could I touch my goal?
> I have to mention that i am not using any interface. My code is based on
> nullclient example and a java module is taking all the information from my
> shared object through JNI.
> Any suggestion will be highly appreciated.

Unfortunately there is no good way to do this via our API.  At some
point we'll add a prpl callback to set the nickname for your account.
Until then, the only way I know of to do this is something along these
lines:

GList *actions = PURPLE_PLUGIN_ACTIONS(pc->prpl, pc);
for (GList *l = actions; l != NULL; l = l->next) {
    PurplePluginAction *action = (PurplePluginAction *)l->data;
    if (g_str_equal(action->label, _("Set Friendly Name..."))) {
        action->context = pc;
        action->callback(action);
        break;
    }
}
while (actions != NULL) {
    purple_plugin_action_free((PurplePluginAction *)actions->data);
    actions = g_list_delete_link(actions, actions);
}

And then you have to watch for the request in the request API.
There's a little more info in these email threads:
http://pidgin.im/pipermail/devel/2009-September/008858.html
http://pidgin.im/pipermail/devel/2009-December/009065.html

--Mark




More information about the Devel mailing list