mastodon/app/javascript
ThibG 5d5c0f4f43 Twidere mention workaround (#5552)
* Work around Twidere and Tootdon bug

Tootdon and Twidere construct @user@domain handles from mentions in toots based
solely on the mention text and account URI's domain without performing any
webfinger call or retrieving account info from the Mastodon server.

As a result, when a remote user has WEB_DOMAIN ≠ LOCAL_DOMAIN, Twidere and
Tootdon will construct the mention as @user@WEB_DOMAIN. Now, this will usually
resolve to the correct account (since the recommended configuration is to have
WEB_DOMAIN perform webfinger redirections to LOCAL_DOMAIN) when processing
mentions, but won't do so when displaying them (as it does not go through the
whole account resolution at that time).

This change rewrites mentions to the resolved account, so that displaying the
mentions will work.

* Use lookbehind instead of non-capturing group in MENTION_RE

Indeed, substitutions with the previous regexp would erroneously eat any
preceding whitespace, which would lead to concatenated mentions in the
previous commit.

Note that users will “lose” up to one character space per mention for their
toots, as that regexp is also used to remove the domain-part of mentioned
users for character counting purposes, and it also erroneously removed the
preceding character if it was a space.
2017-11-07 19:08:14 +01:00
..
fonts Redesign the landing page, mount public timeline on it (#4122) 2017-07-11 15:27:59 +02:00
images Remove redundant width/height values from SVGs to fix Safari bug (#4956) 2017-09-15 00:51:00 +02:00
mastodon Twidere mention workaround (#5552) 2017-11-07 19:08:14 +01:00
packs Enable ESLint rules import/* (#5414) 2017-10-16 11:12:09 +02:00
styles Add ability to disable login and mark accounts as memorial (#5615) 2017-11-07 19:06:44 +01:00