MActorFull,
MActorHost,
MActorServer,
- MActorSummaryFormattable
+ MActorSummaryFormattable,
+ MActorWithInboxes
} from '../../typings/models'
import * as Bluebird from 'bluebird'
@Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max))
outboxUrl: string
- @AllowNull(false)
- @Is('ActorSharedInboxUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'shared inbox url'))
+ @AllowNull(true)
+ @Is('ActorSharedInboxUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'shared inbox url', true))
@Column(DataType.STRING(CONSTRAINTS_FIELDS.ACTORS.URL.max))
sharedInboxUrl: string
})
}
+ getSharedInbox (this: MActorWithInboxes) {
+ return this.sharedInboxUrl || this.inboxUrl
+ }
+
toFormattedSummaryJSON (this: MActorSummaryFormattable) {
let avatar: Avatar = null
if (this.Avatar) {