hometown/app/javascript/mastodon/features
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
..
account/components Refactor initial state: "me" (#5563) 2017-10-31 11:27:48 +09:00
account_gallery Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
account_timeline Refactor initial state: "me" (#5563) 2017-10-31 11:27:48 +09:00
blocks Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
community_timeline Refactoring streaming connections (#4645) 2017-08-21 15:04:34 +02:00
compose Twidere mention workaround (#5552) 2017-11-07 19:08:14 +01:00
emoji Avoid emojifying on invisible text (#5558) 2017-11-07 14:48:13 +01:00
favourited_statuses Add Smartphone screen favourite back button and adjust styles (#4813) 2017-09-06 17:32:15 +02:00
favourites Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
follow_requests Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
followers Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
following Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
generic_not_found Replace sprockets/browserify with Webpack (#2617) 2017-05-03 02:04:16 +02:00
getting_started Refactor initial state: "me" (#5563) 2017-10-31 11:27:48 +09:00
hashtag_timeline Refactoring streaming connections (#4645) 2017-08-21 15:04:34 +02:00
home_timeline Do not try to guess why home timeline is empty in web UI (#5370) 2017-10-13 16:44:16 +02:00
mutes Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
notifications Implement hotkeys for web UI (#5164) 2017-10-06 01:07:59 +02:00
pinned_statuses Add Pinned toot column (#4817) 2017-09-07 09:58:11 +02:00
public_timeline Refactoring streaming connections (#4645) 2017-08-21 15:04:34 +02:00
reblogs Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
report feat: Cache status height to avoid expensive renders (#4439) 2017-08-07 20:32:03 +02:00
standalone Redesign public hashtag pages (#5237) 2017-10-07 20:00:35 +02:00
status Make fullscreen video in detailed status plays in fullscreen (Partly Fix #5160) (#5611) 2017-11-07 14:24:55 +01:00
ui refactor(features/ui): Avoid useless renders in WrappedSwitch (#5580) 2017-11-01 12:17:53 +01:00
video Fix an error when video playback buffer is empty (#5300) 2017-10-10 15:17:53 +02:00