unable to enable the PurpleAccount.

Etan Reisner pidgin at unreliablesource.net
Tue Feb 24 20:10:34 EST 2009


On Tue, Feb 24, 2009 at 09:59:30AM +0530, Nagesh wrote:
> Hi All,
>
> I have being using the PurpleInterface to communicate
> with the pidgin through dbus.
> I have used the following functions to connect to the pidgin
> and create a new account.
>
> account = intf.PurpleAccountNew(username, protocol_id);
> intf.PurpleAccountSetUsername(account, usernameWithDomain);
> intf.PurpleAccountSetPassword(account, password);
> intf.PurpleAccountConnect(account);
> intf.PurpleAccountRegister(account);

Calling PurpleAccountSetUsername is unnecessary, PurpleAccountNew does
that for you so just give it the username you actually want to use.

Calling both Connect and Register is likely not what you want either, at
least not in that order.

If you need to register the account you need to call Register without
first calling Connect.

> I could able to create new account, but I could not
> enable it.
>
> I used below function with different combination's.
> public void PurpleAccountSetEnabled(int account, String ui, int value);
>
> PurpleAccountSetEnabled(4184,"gtk-gaim", 1);
> PurpleAccountSetEnabled(4184,"gtk-gaim", 0);
> PurpleAccountSetEnabled(4184,"prpl-jabber", 1);
> PurpleAccountSetEnabled(4184,"prpl-jabber", 0);
>
> as I was trying to enable a gmail account.
>
> can any one suggest me what are the proper parameters do I need to
> pass to PurpleAccountSetEnabled method to enable a account.

I'm assuming 4184 is the integer value you got back for the account from
PurpleAccountNew? If that is the case then PurpleAccountSetEnabled(4184,
"gtk-gaim", 1) should work, that should cause the account to become
enabled and to be affected by the global status.

And in a quick test in the python interpreter I was able to make it work
for a pre-existing account.

> Any help is highly appreciated.
>
> Thanks,
> Ajay.

    -Etan




More information about the Devel mailing list