aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actors/updater.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/actors/updater.ts')
-rw-r--r--server/lib/activitypub/actors/updater.ts10
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 @@
1import { resetSequelizeInstance, runInReadCommittedTransaction } from '@server/helpers/database-utils' 1import { resetSequelizeInstance, runInReadCommittedTransaction } from '@server/helpers/database-utils'
2import { logger } from '@server/helpers/logger' 2import { logger } from '@server/helpers/logger'
3import { AccountModel } from '@server/models/account/account'
3import { VideoChannelModel } from '@server/models/video/video-channel' 4import { VideoChannelModel } from '@server/models/video/video-channel'
4import { MAccount, MActor, MActorFull, MChannel } from '@server/types/models' 5import { MAccount, MActor, MActorFull, MChannel } from '@server/types/models'
5import { ActivityPubActor, ActorImageType } from '@shared/models' 6import { ActivityPubActor, ActorImageType } from '@shared/models'
7import { getOrCreateAPOwner } from './get'
6import { updateActorImageInstance } from './image' 8import { updateActorImageInstance } from './image'
7import { fetchActorFollowsCount } from './shared' 9import { fetchActorFollowsCount } from './shared'
8import { getImageInfoFromObject } from './shared/object-to-model-attributes' 10import { 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)