You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/models
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.
7 years ago
..
concerns
form
web Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
account.rb Twidere mention workaround (#5552) 7 years ago
account_domain_block.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
account_filter.rb Improve admin UI for custom emojis, add copy/disable/enable (#5231) 7 years ago
account_moderation_note.rb foreign_key, non-nullable, dependent: destroy in account_moderation_notes (#5294) 7 years ago
application_record.rb
block.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
context.rb
conversation.rb
conversation_mute.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
custom_emoji.rb Show the local couterpart of emoji when it exists in /admin/custom_emojis (#5467) 7 years ago
custom_emoji_filter.rb Improve admin UI for custom emojis, add copy/disable/enable (#5231) 7 years ago
domain_block.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
email_domain_block.rb Implement EmailBlackList (#5109) 7 years ago
export.rb
favourite.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
feed.rb Non-Serial ("Snowflake") IDs (#4801) 7 years ago
follow.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
follow_request.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
import.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
instance.rb
instance_filter.rb
media_attachment.rb
mention.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
mute.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
notification.rb Fix UserTrackingConcern firing on every request, optimize some queries (#5368) 7 years ago
preview_card.rb
remote_follow.rb
remote_profile.rb
report.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
report_filter.rb
search.rb
session_activation.rb
setting.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
site_upload.rb
status.rb Optimize Status#permitted_for 500x (account timeline) (#5373) 7 years ago
status_pin.rb
stream_entry.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
subscription.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
tag.rb
user.rb Add ability to disable login and mark accounts as memorial (#5615) 7 years ago
web.rb