CodedOre / NewCaw

Development on Cawbird 2.0
GNU General Public License v3.0
97 stars 5 forks source link

Media from Reposts and Quotes not retrieved by API #18

Closed CodedOre closed 2 years ago

CodedOre commented 2 years ago

A point which may need to be adressed at some point.

While TwitterLegacy displays media from a repost or quote, Twitter does not:

TwitterLegacy Twitter
Repost displayed with `TwitterLegacy` backend Repost displayed with `Twitter` backend

The issue here is simple: Unlike the old API, the new API don't returns the includes for an referenced_tweet, apart from (optionally) the author.

So, we might need to adress this. We could read the media keys (which are noted) and then issue a call for the original post to retrieve the media (and have a problem with hitting the tweet cap faster).

CodedOre commented 2 years ago

Just a note: This would effect all includes, including mentioned users, media and polls.

IBBoard commented 2 years ago

That's… bad. Are there really no options to enable them? Because that seems like rather fundamental content! Do things like tweet.fields only apply to tweets and not the inner RT (and presumably quoted tweet)?

CodedOre commented 2 years ago

tweet.fields are applied to referenced_tweet as well. However, media, users and polls are separate objects only referenced by their id in a tweet object and need to be called with the expansions argument, and these are only applied to top-level tweets, not the referenced one, which is why they have an additional referenced_tweets.id.author_id so you can at least get the user object for the original poster.

CodedOre commented 2 years ago

This issue is resolved. We now only request the id of the referenced tweet and then load it when needed. This way we get the includes as well.

This also solves the issue that in a retweet of an quote the quoted tweet is not pulled.