]> cat aescling's git repositories - mastodon.git/commitdiff
Fix moved account handling in IndexedDB feature (#6915)
authorunarist <m.unarist@gmail.com>
Mon, 26 Mar 2018 10:48:01 +0000 (19:48 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 26 Mar 2018 10:48:01 +0000 (12:48 +0200)
* Fix stack overflow on importFetchedAccounts

  When the account has moved property, it should process destination
  account instead of source account itself.

* Set account id instead of account object for moved property

  This restores "foo has moved to" indication on account view, and
  fixes `reblog` index on `accounts` object store.

app/javascript/mastodon/actions/importer/index.js
app/javascript/mastodon/actions/importer/normalizer.js

index d1ea40c36070b55e205e7abca3ced46861653de3..a97f4d173cf251e849aaf503adfe65326a0377f3 100644 (file)
@@ -39,7 +39,7 @@ export function importFetchedAccounts(accounts) {
     pushUnique(normalAccounts, normalizeAccount(account));
 
     if (account.moved) {
-      processAccount(account);
+      processAccount(account.moved);
     }
   }
 
index c88f6946fe86c4ec443fe2486d5a122ad2dc4a82..1b09f319ff87be06a833ff7c818a833b6ef48f3b 100644 (file)
@@ -10,6 +10,10 @@ export function normalizeAccount(account) {
   account.display_name_html = emojify(escapeTextContentForBrowser(displayName));
   account.note_emojified = emojify(account.note);
 
+  if (account.moved) {
+    account.moved = account.moved.id;
+  }
+
   return account;
 }