Skip to content

Commit

Permalink
fix Firefish
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name authored and alphatownsman committed Oct 15, 2024
1 parent 72d9fb2 commit 1b4c1ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mastodon/models/mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,17 @@ def authenticate(domain, access_token, refresh_token) -> "MastodonAccount | None
uid=mastodon_account.uid,
domain=mastodon_account.domain,
).first()
if not existing_account:
existing_account = MastodonAccount.objects.filter(
handle=mastodon_account.handle,
domain=mastodon_account.domain,
).first()
if existing_account:
# this is only needed if server is Firefish
logger.warning(
f"USER ID CHANGED: {existing_account.uid} -> {mastodon_account.uid} for {existing_account.handle}"
)
existing_account.uid = mastodon_account.uid
if existing_account:
existing_account.access_token = mastodon_account.access_token
existing_account.refresh_token = mastodon_account.refresh_token
Expand Down

0 comments on commit 1b4c1ef

Please sign in to comment.