libpurple / find active conversations

Etan Reisner pidgin at unreliablesource.net
Wed Jul 8 11:41:43 EDT 2009


On Wed, Jul 08, 2009 at 05:06:07PM +0200, Cedric Roche wrote:
>
> I just want to send messages. If a PurpleConversation is already open between the two buddies, I want to use the existing one and not create a new one.
> I want to loop over the buddy list in order to use purple_find_conversation_with_account.
>
> I'm sorry I have  trouble to understand libpurple.
>
> Thx

If you know the buddy you are sending to then you don't need to loop over
the buddy list to find their name do you? So why can't you just use the
buddy name in the find_conversation_with_account call directly? If you
don't know the buddy name then how were you going to pick them from the
buddy list to send to at all?

But that's even more work than you technically need to do, as
purple_conversation_new will re-use an existing IM conversation if one
already exists.

    -Etan




More information about the Devel mailing list