purple_conv_im_send works not as expected
Daniel Atallah
daniel.atallah at gmail.com
Sat Nov 24 09:59:51 EST 2007
On Nov 24, 2007 8:53 AM, Anatoliy Belsky <anatoliy at belsky.info> wrote:
> Hi,
>
> i have the following question. I'm trying to start a new conversation with
> the
> code like this:
>
> account = purple_account_new(name, prpl);
> purple_account_set_password(account, password);
> purple_account_set_enabled(account, UI_ID, TRUE);
>
> conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account,
> "somebody");
> purple_conv_im_send(PURPLE_CONV_IM(conv), "hi there!");
>
> but this not works at all. If the I check the account with
> purple_account_is_connected(account), it turns out, that the account is
> not
> connected yet. So in fact the account goes online after about 5 seconds
> after
> the conversation has being started.
>
Libpurple doesn't block until the account is connected. Libpurple was
designed to drive a single-threaded UI client, if functions like that
blocked, the UI would be unusable. You need to wait until the account is
online before sending stuff (using the "signed-on" signal - see
http://developer.pidgin.im/doxygen/dev/html/connection-signals.html#signed-on
).
-D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20071124/6fd525cf/attachment.html>
More information about the Devel
mailing list