开发者

Querying stream table for user's own posts returns photo tags by others

开发者 https://www.devze.com 2023-03-20 15:51 出处:网络
I am querying the stream table to retrieve everything that the logged in user has posted recently. I am using the following query:

I am querying the stream table to retrieve everything that the logged in user has posted recently. I am using the following query:

SELECT source_id, actor_id, app_id, post_id, created_time, message, likes, attachment FROM stream WHERE source_id = XXXXX AND actor_id = XXXXX

The problem is that the response includes entries for when other use开发者_如何学Crs have tagged the logged in user in photos, which I don't consider to be a post from the logged in user him/herself.

I have looked at other fields in the stream table such as taget_id and viewer_id but cannot find a way to limit the results.

Can anyone help me to excludes these tag posts or identify in the returned data which entries are tagged photos (or other things that can be tagged)?

Thank you in advance.

// Peter


You can accomplish what you're trying to do by looping over the entries, and if the attachment is a photo or video, checking to see if the owner id is the same as the user id. If it's a different user id, then you know they didn't post it and they were just tagged in the photo.

0

精彩评论

暂无评论...
验证码 换一张
取 消