diff options
Diffstat (limited to 'server/lib/activitypub/actors/updater.ts')
-rw-r--r-- | server/lib/activitypub/actors/updater.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/lib/activitypub/actors/updater.ts b/server/lib/activitypub/actors/updater.ts index de5e03eee..042438d9c 100644 --- a/server/lib/activitypub/actors/updater.ts +++ b/server/lib/activitypub/actors/updater.ts | |||
@@ -1,8 +1,10 @@ | |||
1 | import { resetSequelizeInstance, runInReadCommittedTransaction } from '@server/helpers/database-utils' | 1 | import { resetSequelizeInstance, runInReadCommittedTransaction } from '@server/helpers/database-utils' |
2 | import { logger } from '@server/helpers/logger' | 2 | import { logger } from '@server/helpers/logger' |
3 | import { AccountModel } from '@server/models/account/account' | ||
3 | import { VideoChannelModel } from '@server/models/video/video-channel' | 4 | import { VideoChannelModel } from '@server/models/video/video-channel' |
4 | import { MAccount, MActor, MActorFull, MChannel } from '@server/types/models' | 5 | import { MAccount, MActor, MActorFull, MChannel } from '@server/types/models' |
5 | import { ActivityPubActor, ActorImageType } from '@shared/models' | 6 | import { ActivityPubActor, ActorImageType } from '@shared/models' |
7 | import { getOrCreateAPOwner } from './get' | ||
6 | import { updateActorImageInstance } from './image' | 8 | import { updateActorImageInstance } from './image' |
7 | import { fetchActorFollowsCount } from './shared' | 9 | import { fetchActorFollowsCount } from './shared' |
8 | import { getImageInfoFromObject } from './shared/object-to-model-attributes' | 10 | import { getImageInfoFromObject } from './shared/object-to-model-attributes' |
@@ -36,7 +38,13 @@ export class APActorUpdater { | |||
36 | this.accountOrChannel.name = this.actorObject.name || this.actorObject.preferredUsername | 38 | this.accountOrChannel.name = this.actorObject.name || this.actorObject.preferredUsername |
37 | this.accountOrChannel.description = this.actorObject.summary | 39 | this.accountOrChannel.description = this.actorObject.summary |
38 | 40 | ||
39 | if (this.accountOrChannel instanceof VideoChannelModel) this.accountOrChannel.support = this.actorObject.support | 41 | if (this.accountOrChannel instanceof VideoChannelModel) { |
42 | const owner = await getOrCreateAPOwner(this.actorObject, this.actorObject.url) | ||
43 | this.accountOrChannel.accountId = owner.Account.id | ||
44 | this.accountOrChannel.Account = owner.Account as AccountModel | ||
45 | |||
46 | this.accountOrChannel.support = this.actorObject.support | ||
47 | } | ||
40 | 48 | ||
41 | await runInReadCommittedTransaction(async t => { | 49 | await runInReadCommittedTransaction(async t => { |
42 | await updateActorImageInstance(this.actor, ActorImageType.AVATAR, avatarInfo, t) | 50 | await updateActorImageInstance(this.actor, ActorImageType.AVATAR, avatarInfo, t) |