Skip to content
Snippets Groups Projects
Verified Commit a2c2ea8b authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fixed an issue with local mastodon accounts

parent eb3408ca
No related branches found
No related tags found
No related merge requests found
Pipeline #4238 passed
...@@ -109,14 +109,22 @@ export default { ...@@ -109,14 +109,22 @@ export default {
} }
handledFavorites += 1 handledFavorites += 1
results.progressCount += 1 results.progressCount += 1
let account = `webfinger:${f.account.acct}` let accountId
if (results.accounts[account]) { if (f.account.acct.indexOf('@') > -1) {
results.accounts[account].weight += 1 // the account has full id already
let detail = get(results.accounts[account], 'detail', {}) accountId = `webfinger:${f.account.acct}`
} else {
// it's probably a local account, we add the domain by hand
accountId = `webfinger:${f.account.acct}@${account.domain}`
}
if (results.accounts[accountId]) {
results.accounts[accountId].weight += 1
let detail = get(results.accounts[accountId], 'detail', {})
let mastodonDetail = get(detail, 'mastodon', {favorites: 0}) let mastodonDetail = get(detail, 'mastodon', {favorites: 0})
mastodonDetail.favorites += 1 mastodonDetail.favorites += 1
} else { } else {
results.accounts[account] = { results.accounts[accountId] = {
weight: 1, weight: 1,
source: 'webfinger', source: 'webfinger',
id: f.account.acct, id: f.account.acct,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment