Verified Commit a2c2ea8b authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fixed an issue with local mastodon accounts

parent eb3408ca
Pipeline #4238 passed with stages
in 1 minute and 12 seconds
......@@ -109,14 +109,22 @@ export default {
}
handledFavorites += 1
results.progressCount += 1
let account = `webfinger:${f.account.acct}`
if (results.accounts[account]) {
results.accounts[account].weight += 1
let detail = get(results.accounts[account], 'detail', {})
let accountId
if (f.account.acct.indexOf('@') > -1) {
// the account has full id already
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})
mastodonDetail.favorites += 1
} else {
results.accounts[account] = {
results.accounts[accountId] = {
weight: 1,
source: 'webfinger',
id: f.account.acct,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment