Add InReplyToStatus, QuotedStatus and RetweetedStatus parsing in Tweet

BREAKING CHANGE: Retweet property renamed to RetweetedStatus
Closed #41
This commit is contained in:
Alexander Sheiko 2021-07-16 12:21:41 +03:00
parent c370a9078f
commit be2c3ec5b1
3 changed files with 60 additions and 22 deletions

View file

@ -167,13 +167,15 @@ func (timeline *timeline) parseTweet(id string) *Tweet {
if tweet.QuotedStatusIDStr != "" {
tw.IsQuoted = true
tw.QuotedStatus = timeline.parseTweet(tweet.QuotedStatusIDStr)
}
if tweet.InReplyToStatusIDStr != "" {
tw.IsReply = true
tw.InReplyToStatus = timeline.parseTweet(tweet.InReplyToStatusIDStr)
}
if tweet.RetweetedStatusIDStr != "" {
tw.IsRetweet = true
tw.Retweet = timeline.parseTweet(tweet.RetweetedStatusIDStr)
tw.RetweetedStatus = timeline.parseTweet(tweet.RetweetedStatusIDStr)
}
for _, pinned := range timeline.GlobalObjects.Users[tweet.UserIDStr].PinnedTweetIdsStr {