Start chat Conversation

Etan Reisner pidgin at unreliablesource.net
Fri Jul 31 16:07:46 EDT 2009


On Tue, Jul 14, 2009 at 04:29:48AM -0700, rico_1 wrote:
> Hello!
>
> I have small question. How can I start new chat Conversation in
> libPurple. I have connected account. IM conversation work. I have
> problem with starting new chat conversation. (for test I'm using gadu-
> gadu protocol).
> This is part of my code:
>
> if (!(conv = purple_find_conversation_with_account
> (PURPLE_CONV_TYPE_CHAT, "conf#0", account.getPurpleAccount())))
>     {
>          conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT,
> account.getPurpleAccount(), "conf#0");
>
>          purple_conv_chat_add_user(PURPLE_CONV_CHAT(conv), "NUMBER",
> NULL, PURPLE_CBFLAGS_NONE , true);
>     }
>     else
>          purple_conversation_present(conv);
>
> // sending message
>     purple_conv_chat_send(PURPLE_CONV_CHAT(conv), "Hello chat
> users.");
>
> Best Regard

Unlike IM conversations chat rooms on virtually all networks need to
actually be created before being used, as such you cannot just create them
locally. You need to tell libpurple (and the prpl) to join the chat room
first, see server.c:serv_chat_join (and functions like
gtkblist.c:gtk_blist_join_chat for how it is used).

    -Etan




More information about the Devel mailing list