renatolond / mastodon-twitter-poster

Crossposter to post statuses between Mastodon and Twitter
GNU Affero General Public License v3.0
807 stars 58 forks source link

Fix replacing masto usernames in status links #923

Closed tarushnagpal closed 1 year ago

tarushnagpal commented 1 year ago

Fixes https://github.com/renatolond/mastodon-twitter-poster/issues/922

tarushnagpal commented 1 year ago

Will make sure status links, such as https://mastodon.social/@overholt@glammr.us/109587412485871313 Do not match our regex since a masto mention @overholt@glammr.us is a part of them

renatolond commented 1 year ago

Code-wise I think it's looking good, can you add a regression test to make sure this doesn't happen again?

renatolond commented 1 year ago

To be completely fair, a full fix of this would be to unfurl the link, this: https://mastodon.social/@overholt@glammr.us/109587412485871313 should actually be https://glammr.us/@overholt/109587411932871112, but that would require an extra HTTP call for each link in that format

tarushnagpal commented 1 year ago

Have added a test,

but that would require an extra HTTP call for each link in that format Hmm yeah, we should probably avoid that.