iYousafzai
iYousafzai

Reputation: 1071

Conversation with a specific user

How can i get conversation of a specific user from my inbox using the uid of the user with fql query or multi-query? For Example: if i want conversation between user X with uid=786758454 and me?

something like this

SELECT message_id, thread_id, author_id, body, created_time, viewer_id 
FROM message WHERE thread_id IN 
(SELECT thread_id, subject, recipients FROM thread WHERE folder_id =0 )
AND author_id = 'user X uid' ORDER BY created_time DESC LIMIT 0,25

Upvotes: 0

Views: 63

Answers (1)

Ifwat
Ifwat

Reputation: 1553

You need the both user id. The user X uid and your uid. Try using this fql query:

SELECT message_id, thread_id, author_id, body, created_time, viewer_id FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) and (author_id = 'user X uid' or author_id = 'YOUR user uid') ORDER BY created_time DESC

Hope this can solve your problem.

Upvotes: 0

Related Questions