purple_find_conversation_with_account()

Lucas Soltic lucas.soltic at orange.fr
Mon Apr 22 16:43:32 EDT 2013


Le 22 avr. 2013 à 18:16, Mark Doliner <mark at kingant.net> a écrit :

> On Mon, Apr 22, 2013 at 6:58 AM, Lucas Soltic <lucas.soltic at orange.fr> wrote:
>> Are there assumptions about when purple_find_conversation_with_account() can find a PurpleConversation and when it cannot?
> 
> It should always work.  Are you sure you're giving it the same
> parameters in both cases?  Maybe the buddy name has a resource the
> first time you call it but not the second?

I did check and the parameters are not exactly the same, but I expect this to be normal as the account for which I want the conversation is not the same when you're the receiver (looking for the conversation with the sender) and when you're the sender (looking for the conversation with the receiver).

Here is the output I get. OUTPUT is when a message is being sent and INPUT when it is being received.

First message from other at gmail.com to xxmppp at gmail.com:

purple_find_conversation_with_account(1, xxmppp at gmail.com, 0x7fe5b0c5baa0 (other at gmail.com/))
OUTPUT PurpleConversation found for user xxmppp at gmail.com!

purple_find_conversation_with_account(1, other at gmail.com/E1F93DD8, 0x7fe5b0c71270 (xxmppp at gmail.com/))
INPUT PurpleConversation NOT found for user other at gmail.com/E1F93DD8!


Second message from other at gmail.com to xxmppp at gmail.com:

purple_find_conversation_with_account(1, xxmppp at gmail.com, 0x7fe5b0c5baa0 (other at gmail.com/))
OUTPUT PurpleConversation found for user xxmppp at gmail.com!

purple_find_conversation_with_account(1, other at gmail.com/E1F93DD8, 0x7fe5b0c71270 (xxmppp at gmail.com/))
INPUT PurpleConversation found for user other at gmail.com/E1F93DD8!

Le 22 avr. 2013 à 20:06, Daniel Atallah <datallah at pidgin.im> a écrit :

> On Mon, Apr 22, 2013 at 9:58 AM, Lucas Soltic <lucas.soltic at orange.fr> wrote:
>> Hello,
>> 
>> Are there assumptions about when purple_find_conversation_with_account() can find a PurpleConversation and when it cannot?
> 
> purple_find_conversation_with_account will only find an existing
> conversation, and not initiate a new one.  Is that, perhaps, the
> difference in behavior that you're seeing?
> 
> -D


Yes you're right. Actually I had made a mistake when calling purple_find_conversation_with_account() (not the right "name" parameter).
Now it's working fine on the second call. And on the first call I guess it's normal as when a XMPP message has been received, it has not yet been transmitted to the libpurple API and thus no PurpleConversation exists yet.

Many thanks to both of you!
Lucas SOLTIC





More information about the Support mailing list