libpurple / find active conversations

View: New views
6 Messages — Rating Filter:   Alert me  

libpurple / find active conversations

by Cedric Roche :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

I need to know the best way to find all active conversation in order to not open a new one when sending a message. I found the function purple_find_conversation_with_account, where the name and the account arguments seems to be the the name and account of a PurpleBuddy structure (please, correct me if I'm wrong). So my guess is that I could do that by exploring the entire buddy list but my question is, is there a better way to do that ?

Thx


Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows LiveĀ ? Lancez-vous !
_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: libpurple / find active conversations

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 08, 2009 at 03:51:26PM +0200, Cedric Roche wrote:
>
> Hi,
>
> I need to know the best way to find all active conversation in order to not open a new one when sending a message. I found the function purple_find_conversation_with_account, where the name and the account arguments seems to be the the name and account of a PurpleBuddy structure (please, correct me if I'm wrong). So my guess is that I could do that by exploring the entire buddy list but my question is, is there a better way to do that ?
>
> Thx

What are you trying to do exactly? Why do you need to know if any random
conversation already exists? What would looping over the buddy list help
you determine?

    -Etan

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

RE: libpurple / find active conversations

by Cedric Roche :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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


> Date: Wed, 8 Jul 2009 10:52:23 -0400
> From: pidgin@...
> To: csced@...
> CC: devel@...
> Subject: Re: libpurple / find active conversations
>
> On Wed, Jul 08, 2009 at 03:51:26PM +0200, Cedric Roche wrote:
> >
> > Hi,
> >
> > I need to know the best way to find all active conversation in order to not open a new one when sending a message. I found the function purple_find_conversation_with_account, where the name and the account arguments seems to be the the name and account of a PurpleBuddy structure (please, correct me if I'm wrong). So my guess is that I could do that by exploring the entire buddy list but my question is, is there a better way to do that ?
> >
> > Thx
>
> What are you trying to do exactly? Why do you need to know if any random
> conversation already exists? What would looping over the buddy list help
> you determine?
>
> -Etan


Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows LiveĀ ? Lancez-vous !
_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Re: libpurple / find active conversations

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

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

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Parent Message unknown Re: libpurple / find active conversations

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 08, 2009 at 06:03:11PM +0200, Cedric Roche wrote:
>
> Ok, thanks I didn't know that purple_conversation_new will re-use an existing one (is that written somewhere ?). I thought that to not create a new PurpleConversation when one already exists, I had to use purple_find_conversation_with_account and this function needs the account corresponding to the buddy and I didn't find a function that return the buddy only with the name.
>
> I'm just going to use  purple_conversation_new every time I send a msg.
>
> Thx

You have a buddy name but not the account it goes with? That's not enough
information to do anything useful, how did that happen? Alternatively, how
did you get a buddy name without getting the account it goes with? How
were you intending to find the correct buddy with that, considering the
same buddy can exist on multiple accounts and that multiple services have
names that cannot be distinguished from one another (AIM and Yahoo! for
example)?

    -Etan

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel

Parent Message unknown Re: libpurple / find active conversations

by Etan Reisner-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 08, 2009 at 06:40:34PM +0200, Cedric Roche wrote:
>
> Well, because I don't understand one thing about the library. I took the nullclient example and add some stuff. In fact I even didn't understand why there is a PurpleAccount in the PurpleBuddy structure. What I was thinking at first is that the PurpleAccount was only the account with which we want to connect with. Why do we need this account if we have the PurpleBuddy ?
>
> Sry I'm  having a difficult time, and libpurple is lacking a real documentation.

The PurpleBuddy documentation[1] indicates that the PurpleAccount in the
PurpleBuddy struct is "the account this buddy belongs to". It exists so
you can get from a PurpleBuddy to the right PurpleAccount. (Why do we not
have a purple_find_conversation(PurpleConversationType, const PurpleBuddy)
I'm not sure other than that one hasn't been added.)

What, specifically, about the API documentation[2] do you find lacking or
hard to understand? What, again specifically, would you have liked to see
to help get you started? Are you willing to write up the sort of beginners
documentation you would have liked to see?

    -Etan

[1] http://developer.pidgin.im/doxygen/dev/html/struct__PurpleBuddy.html

[2] http://developer.pidgin.im/doxygen/
    http://developer.pidgin.im/doxygen/dev/html/main.html
    http://developer.pidgin.im/doxygen/dev/html/modules.html

_______________________________________________
Devel mailing list
Devel@...
http://pidgin.im/cgi-bin/mailman/listinfo/devel