},
{
label: this.i18n('Ban'),
- handler: ({ user }: { user: User }) => this.openBanUserModal(user),
- isDisplayed: ({ user }: { user: User }) => !user.blocked
+ handler: ({ user }) => this.openBanUserModal(user),
+ isDisplayed: ({ user }) => !user.blocked
},
{
label: this.i18n('Unban'),
- handler: ({ user }: { user: User }) => this.unbanUser(user),
- isDisplayed: ({ user }: { user: User }) => user.blocked
+ handler: ({ user }) => this.unbanUser(user),
+ isDisplayed: ({ user }) => user.blocked
},
{
label: this.i18n('Set Email as Verified'),
- handler: ({ user }: { user: User }) => this.setEmailAsVerified(user),
- isDisplayed: ({ user }: { user: User }) => this.requiresEmailVerification && !user.blocked && user.emailVerified === false
+ handler: ({ user }) => this.setEmailAsVerified(user),
+ isDisplayed: ({ user }) => this.requiresEmailVerification && !user.blocked && user.emailVerified === false
}
])
}
this.userActions.push([
{
label: this.i18n('Mute this account'),
- isDisplayed: ({ account }: { account: Account }) => account.mutedByUser === false,
- handler: ({ account }: { account: Account }) => this.blockAccountByUser(account)
+ isDisplayed: ({ account }) => account.mutedByUser === false,
+ handler: ({ account }) => this.blockAccountByUser(account)
},
{
label: this.i18n('Unmute this account'),
- isDisplayed: ({ account }: { account: Account }) => account.mutedByUser === true,
- handler: ({ account }: { account: Account }) => this.unblockAccountByUser(account)
+ isDisplayed: ({ account }) => account.mutedByUser === true,
+ handler: ({ account }) => this.unblockAccountByUser(account)
},
{
label: this.i18n('Mute the instance'),
- isDisplayed: ({ account }: { account: Account }) => !account.userId && account.mutedServerByInstance === false,
- handler: ({ account }: { account: Account }) => this.blockServerByUser(account.host)
+ isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false,
+ handler: ({ account }) => this.blockServerByUser(account.host)
},
{
label: this.i18n('Unmute the instance'),
- isDisplayed: ({ account }: { account: Account }) => !account.userId && account.mutedServerByInstance === true,
- handler: ({ account }: { account: Account }) => this.unblockServerByUser(account.host)
+ isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true,
+ handler: ({ account }) => this.unblockServerByUser(account.host)
}
])
instanceActions = instanceActions.concat([
{
label: this.i18n('Mute this account by your instance'),
- isDisplayed: ({ account }: { account: Account }) => account.mutedByInstance === false,
- handler: ({ account }: { account: Account }) => this.blockAccountByInstance(account)
+ isDisplayed: ({ account }) => account.mutedByInstance === false,
+ handler: ({ account }) => this.blockAccountByInstance(account)
},
{
label: this.i18n('Unmute this account by your instance'),
- isDisplayed: ({ account }: { account: Account }) => account.mutedByInstance === true,
- handler: ({ account }: { account: Account }) => this.unblockAccountByInstance(account)
+ isDisplayed: ({ account }) => account.mutedByInstance === true,
+ handler: ({ account }) => this.unblockAccountByInstance(account)
}
])
}
instanceActions = instanceActions.concat([
{
label: this.i18n('Mute the instance by your instance'),
- isDisplayed: ({ account }: { account: Account }) => !account.userId && account.mutedServerByInstance === false,
- handler: ({ account }: { account: Account }) => this.blockServerByInstance(account.host)
+ isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false,
+ handler: ({ account }) => this.blockServerByInstance(account.host)
},
{
label: this.i18n('Unmute the instance by your instance'),
- isDisplayed: ({ account }: { account: Account }) => !account.userId && account.mutedServerByInstance === true,
- handler: ({ account }: { account: Account }) => this.unblockServerByInstance(account.host)
+ isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === true,
+ handler: ({ account }) => this.unblockServerByInstance(account.host)
}
])
}
type AvailableForListIDsOptions = {
serverAccountId: number
- actorId: number
+ followerActorId: number
includeLocalVideos: boolean
filter?: VideoFilter
categoryOneOf?: number[]
query.include.push(videoChannelInclude)
}
- if (options.actorId) {
+ if (options.followerActorId) {
let localVideosReq = ''
if (options.includeLocalVideos === true) {
localVideosReq = ' UNION ALL ' +
}
// Force actorId to be a number to avoid SQL injections
- const actorIdNumber = parseInt(options.actorId.toString(), 10)
+ const actorIdNumber = parseInt(options.followerActorId.toString(), 10)
query.where[ 'id' ][ Sequelize.Op.and ].push({
[ Sequelize.Op.in ]: Sequelize.literal(
'(' +
filter?: VideoFilter,
accountId?: number,
videoChannelId?: number,
- actorId?: number
+ followerActorId?: number
trendingDays?: number,
user?: UserModel
}, countVideos = true) {
const serverActor = await getServerActor()
- // actorId === null has a meaning, so just check undefined
- const actorId = options.actorId !== undefined ? options.actorId : serverActor.id
+ // followerActorId === null has a meaning, so just check undefined
+ const followerActorId = options.followerActorId !== undefined ? options.followerActorId : serverActor.id
const queryOptions = {
- actorId,
+ followerActorId,
serverAccountId: serverActor.Account.id,
nsfw: options.nsfw,
categoryOneOf: options.categoryOneOf,
const serverActor = await getServerActor()
const queryOptions = {
- actorId: serverActor.id,
+ followerActorId: serverActor.id,
serverAccountId: serverActor.Account.id,
includeLocalVideos: options.includeLocalVideos,
nsfw: options.nsfw,
// threshold corresponds to how many video the field should have to be returned
static async getRandomFieldSamples (field: 'category' | 'channelId', threshold: number, count: number) {
const serverActor = await getServerActor()
- const actorId = serverActor.id
+ const followerActorId = serverActor.id
const scopeOptions: AvailableForListIDsOptions = {
serverAccountId: serverActor.Account.id,
- actorId,
+ followerActorId,
includeLocalVideos: true
}