1
0
Fork 1
forked from fedi/mastodon
mastodon/app
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
..
controllers Add ability to disable login and mark accounts as memorial (#5615) 2017-11-07 19:06:44 +01:00
helpers Show the local couterpart of emoji when it exists in /admin/custom_emojis (#5467) 2017-11-07 14:49:32 +01:00
javascript Twidere mention workaround (#5552) 2017-11-07 19:08:14 +01:00
lib Avoid emojifying on invisible text (#5558) 2017-11-07 14:48:13 +01:00
mailers Add ability to disable login and mark accounts as memorial (#5615) 2017-11-07 19:06:44 +01:00
models Twidere mention workaround (#5552) 2017-11-07 19:08:14 +01:00
policies Add status destroy authorization to policy (#3453) 2017-05-30 22:56:31 +02:00
presenters Compact status_ids in StatusRelationshipsPresenter (#5073) 2017-09-24 11:18:32 +02:00
serializers Hide disabled custom emojis from emoji picker and emoji auto suggestions. (#5613) 2017-11-07 14:24:21 +01:00
services Twidere mention workaround (#5552) 2017-11-07 19:08:14 +01:00
validators Implement EmailBlackList (#5109) 2017-10-04 15:16:10 +02:00
views Add ability to disable login and mark accounts as memorial (#5615) 2017-11-07 19:06:44 +01:00
workers Add ability to disable login and mark accounts as memorial (#5615) 2017-11-07 19:06:44 +01:00