用于获取聊天对话的FQL查询

时间:2012-08-23 14:52:43

标签: facebook chat history facebook-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

此代码仅返回我的朋友数据。

2 个答案:

答案 0 :(得分:0)

您已将回复的评论限制为仅由您的朋友撰写的评论。

更改

AND author_id = FRIEND_ID

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

在查询的`WHERE子句中。

答案 1 :(得分: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