diff options
Diffstat (limited to 'server/models/activitypub/actor.ts')
-rw-r--r-- | server/models/activitypub/actor.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts index 535ebd792..42a24b583 100644 --- a/server/models/activitypub/actor.ts +++ b/server/models/activitypub/actor.ts | |||
@@ -44,7 +44,8 @@ import { | |||
44 | MActorFull, | 44 | MActorFull, |
45 | MActorHost, | 45 | MActorHost, |
46 | MActorServer, | 46 | MActorServer, |
47 | MActorSummaryFormattable | 47 | MActorSummaryFormattable, |
48 | MActorWithInboxes | ||
48 | } from '../../typings/models' | 49 | } from '../../typings/models' |
49 | import * as Bluebird from 'bluebird' | 50 | import * as Bluebird from 'bluebird' |
50 | 51 | ||
@@ -179,8 +180,8 @@ export class ActorModel extends Model<ActorModel> { | |||
179 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) | 180 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) |
180 | outboxUrl: string | 181 | outboxUrl: string |
181 | 182 | ||
182 | @AllowNull(false) | 183 | @AllowNull(true) |
183 | @Is('ActorSharedInboxUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'shared inbox url')) | 184 | @Is('ActorSharedInboxUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'shared inbox url', true)) |
184 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) | 185 | @Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max)) |
185 | sharedInboxUrl: string | 186 | sharedInboxUrl: string |
186 | 187 | ||
@@ -402,6 +403,10 @@ export class ActorModel extends Model<ActorModel> { | |||
402 | }) | 403 | }) |
403 | } | 404 | } |
404 | 405 | ||
406 | getSharedInbox (this: MActorWithInboxes) { | ||
407 | return this.sharedInboxUrl || this.inboxUrl | ||
408 | } | ||
409 | |||
405 | toFormattedSummaryJSON (this: MActorSummaryFormattable) { | 410 | toFormattedSummaryJSON (this: MActorSummaryFormattable) { |
406 | let avatar: Avatar = null | 411 | let avatar: Avatar = null |
407 | if (this.Avatar) { | 412 | if (this.Avatar) { |