MAccountAP,
MAccountDefault,
MAccountFormattable,
+ MAccountHost,
MAccountSummaryFormattable,
- MChannelActor
+ MChannelHost
} from '../../types/models'
import { ActorModel } from '../actor/actor'
import { ActorFollowModel } from '../actor/actor-follow'
import { ApplicationModel } from '../application/application'
import { ServerModel } from '../server/server'
import { ServerBlocklistModel } from '../server/server-blocklist'
-import { UserModel } from '../user/user'
import { buildSQLAttributes, getSort, throwIfNotValid } from '../shared'
+import { UserModel } from '../user/user'
import { VideoModel } from '../video/video'
import { VideoChannelModel } from '../video/video-channel'
import { VideoCommentModel } from '../video/video-comment'
{
model: ActorModel,
required: true,
- where: {
- preferredUsername: name
- }
+ where: ActorModel.wherePreferredUsername(name)
}
]
}
{
model: ActorModel,
required: true,
- where: {
- preferredUsername: name
- },
+ where: ActorModel.wherePreferredUsername(name),
include: [
{
model: ServerModel,
.findAll(query)
}
- getClientUrl () {
- return WEBSERVER.URL + '/accounts/' + this.Actor.getIdentifier()
- }
-
toFormattedJSON (this: MAccountFormattable): Account {
return {
...this.Actor.toFormattedJSON(),
}
}
- toActivityPubObject (this: MAccountAP) {
- const obj = this.Actor.toActivityPubObject(this.name)
+ async toActivityPubObject (this: MAccountAP) {
+ const obj = await this.Actor.toActivityPubObject(this.name)
return Object.assign(obj, {
summary: this.description
return this.name
}
- getLocalUrl (this: MAccountActor | MChannelActor) {
- return WEBSERVER.URL + `/accounts/` + this.Actor.preferredUsername
+ // Avoid error when running this method on MAccount... | MChannel...
+ getClientUrl (this: MAccountHost | MChannelHost) {
+ return WEBSERVER.URL + '/a/' + this.Actor.getIdentifier()
}
isBlocked () {