1

是否可以从特定用户那里获取消息?

如果我想收到收件人是我自己和 x 的所有邮件

我没有找到创建这种查询的方法,有可能吗?

4

2 回答 2

1
var fbid = your_fbuid_here;          
        FB.api({
                    method: 'fql.query',
                    query: 'SELECT thread_id, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time ASC LIMIT 1'
                }, function ( threadresponse ) {
                    FB.api({
                        method: 'fql.query',
                        query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id = ' + threadresponse[0].thread_id + ' ORDER BY created_time ASC'
                    }, function ( inboxresponse ) {
                            //do stuff here with results
                    });
                });

或者你可以这样做

 var fbid =the _freind_fb_uid_here;          
            FB.api({
                        method: 'fql.query',
                        query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time DESC'
                    }, function ( threadresponse ) {
                                //do stuff here with results
                    }); 

于 2012-02-18T04:51:11.300 回答
0

现在 FQL 没有 field author_id,只有originatorand snippet_author。但是这个字段包含错误的数据。例如,userA 向我发送 (userB) 消息:userA 创建线程。无论如何,我看到了,那个发起者有我(userB)。

最佳使用方式recipients

SELECT recipients,snippet,object_id,updated_time,unread,unseen,thread_id FROM thread WHERE folder_id=0 AND recipients IN (userA_fid, userB_fid)

但它也不起作用并返回空数据......

于 2014-05-24T11:12:10.520 回答