diff options
Diffstat (limited to 'server/models/activitypub/actor.ts')
-rw-r--r-- | server/models/activitypub/actor.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index d651a281a..00e8dc954 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -16,7 +16,7 @@ import { | |||
16 | Table, | 16 | Table, |
17 | UpdatedAt | 17 | UpdatedAt |
18 | } from 'sequelize-typescript' | 18 | } from 'sequelize-typescript' |
19 | import { ActivityPubActorType } from '../../../shared/models/activitypub' | 19 | import { ActivityIconObject, ActivityPubActorType } from '../../../shared/models/activitypub' |
20 | import { Avatar } from '../../../shared/models/avatars/avatar.model' | 20 | import { Avatar } from '../../../shared/models/avatars/avatar.model' |
21 | import { activityPubContextify } from '../../helpers/activitypub' | 21 | import { activityPubContextify } from '../../helpers/activitypub' |
22 | import { | 22 | import { |
@@ -335,7 +335,7 @@ export class ActorModel extends Model<ActorModel> { | |||
335 | const query = { | 335 | const query = { |
336 | where: { | 336 | where: { |
337 | followersUrl: { | 337 | followersUrl: { |
338 | [ Op.in ]: followersUrls | 338 | [Op.in]: followersUrls |
339 | } | 339 | } |
340 | }, | 340 | }, |
341 | transaction | 341 | transaction |
@@ -362,7 +362,7 @@ export class ActorModel extends Model<ActorModel> { | |||
362 | .findOne(query) | 362 | .findOne(query) |
363 | .then(actor => { | 363 | .then(actor => { |
364 | if (preferredUsername === SERVER_ACTOR_NAME) { | 364 | if (preferredUsername === SERVER_ACTOR_NAME) { |
365 | ActorModel.localNameCache[ preferredUsername ] = actor | 365 | ActorModel.localNameCache[preferredUsername] = actor |
366 | } | 366 | } |
367 | 367 | ||
368 | return actor | 368 | return actor |
@@ -388,7 +388,7 @@ export class ActorModel extends Model<ActorModel> { | |||
388 | .findOne(query) | 388 | .findOne(query) |
389 | .then(actor => { | 389 | .then(actor => { |
390 | if (preferredUsername === SERVER_ACTOR_NAME) { | 390 | if (preferredUsername === SERVER_ACTOR_NAME) { |
391 | ActorModel.localUrlCache[ preferredUsername ] = actor | 391 | ActorModel.localUrlCache[preferredUsername] = actor |
392 | } | 392 | } |
393 | 393 | ||
394 | return actor | 394 | return actor |
@@ -500,9 +500,11 @@ export class ActorModel extends Model<ActorModel> { | |||
500 | } | 500 | } |
501 | 501 | ||
502 | toActivityPubObject (this: MActorAP, name: string) { | 502 | toActivityPubObject (this: MActorAP, name: string) { |
503 | let icon = undefined | 503 | let icon: ActivityIconObject |
504 | |||
504 | if (this.avatarId) { | 505 | if (this.avatarId) { |
505 | const extension = extname(this.Avatar.filename) | 506 | const extension = extname(this.Avatar.filename) |
507 | |||
506 | icon = { | 508 | icon = { |
507 | type: 'Image', | 509 | type: 'Image', |
508 | mediaType: extension === '.png' ? 'image/png' : 'image/jpeg', | 510 | mediaType: extension === '.png' ? 'image/png' : 'image/jpeg', |