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 Fix #4908 - Do not keep remote file names, generate random (#4934) 7 years ago
form Default follows for new users (#4871) 7 years ago
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 Fix rubocop issues, introduce usage of frozen literal to improve performance 8 years ago
block.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
context.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
conversation.rb Conditional validations no longer accept strings for if/unless (#3124) 8 years ago
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 Settings export refactor (#1646) 8 years ago
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 Add Instance class to list admin records (#3443) 8 years ago
instance_filter.rb Add instance search feature (#4925) 7 years ago
media_attachment.rb Increase attachment descriptions to 420 characters (#5139) 7 years ago
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 Increase max height of preview card image (#5092) 7 years ago
remote_follow.rb rescue HTTP::ConnectionError in RemoteFollowController#create (#4726) 8 years ago
remote_profile.rb Introduce OStatus::TagManager (#5008) 7 years ago
report.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
report_filter.rb Admin reports with accounts (#2092) 8 years ago
search.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
session_activation.rb Refactor Web::PushSubscription, remove welcome message (#4524) 8 years ago
setting.rb Make IdsToBigints (mostly!) non-blocking (#5088) 7 years ago
site_upload.rb Uploads for admin site settings (#4913) 7 years ago
status.rb Optimize Status#permitted_for 500x (account timeline) (#5373) 7 years ago
status_pin.rb Allow multiple pinned statuses to be shown and make them be ordered b… (#4690) 8 years ago
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 add validation to tag name (#4194) 8 years ago
user.rb Add ability to disable login and mark accounts as memorial (#5615) 7 years ago
web.rb Add extended about page stub 8 years ago