Implement a retweet/reshare functionality using Parse [closed]

对着背影说爱祢 提交于 2019-12-13 09:46:19

问题


I've been stuck on this topic for awhile now, so any guidance would be appreciated.

Here's the setup: User A is following user B, but not user C. User B reshares a post from user C. The reshared post now shows up in user A's feed as the original post from user C and reshared by user B.

Really confused on what the structure of this looks like. I'm using Parse so it's safe to assume that I have the standard Users class and a Posts class.


回答1:


I would add a reference column to your Posts class that can hold a reference to another post. When user B re-shares the post you create a new entry in the Posts class that contains the reference to the original post but is listed as a post from B.

Now when you retrieve the posts that A is subscribed too, you will get the "repost" - you need to follow the reference to get the original content from C. If you allow re-posts of re-posts then you may need to repeat this de-referencing until you get to the original post.



来源:https://stackoverflow.com/questions/24603450/implement-a-retweet-reshare-functionality-using-parse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!