2012-08-23 42 views
4

以下是代碼。結果我想看到我的談話和我的朋友談話。對於對話歷史記錄功能我該怎麼做?獲取聊天對話的FQL查詢

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 = 'xxxxxxxxxxxxxxx' ORDER BY created_time DESC LIMIT 0,25 

此代碼只返回我的朋友數據。

回答

0

您已將回復的評論限制在僅由您的朋友撰寫的評論中。

變化

AND author_id = FRIEND_ID 

AND (author_id = FRIEND_ID OR author_id = me()) 

在`您的查詢的WHERE子句。

+0

這個答案獲取消息,其中author_id是你,即任何消息,你曾經發送 – Jason

0

使用您的原始查詢獲取thread_id,然後嘗試此fql查詢。我認爲一個thread_id屬於整個對話

SELECT message_id, thread_id,source,author_id,body,created_time,viewer_id FROM 
message WHERE thread_id=THREAD_id AND (author_id=FRIEND_ID OR 
author_id=me()) ORDER BY created_time DESC LIMIT 0,25