Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twidere mention workaround #5552

Merged
merged 2 commits into from
Nov 7, 2017

Commits on Nov 7, 2017

  1. 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.
    ClearlyClaire committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    805f787 View commit details
    Browse the repository at this point in the history
  2. 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.
    ClearlyClaire committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    1519335 View commit details
    Browse the repository at this point in the history