followup merge
This commit is contained in:
parent
4c40d0a809
commit
d681dc42e8
|
@ -172,10 +172,6 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
@Inject(DI.antennasRepository)
|
@Inject(DI.antennasRepository)
|
||||||
private antennasRepository: AntennasRepository,
|
private antennasRepository: AntennasRepository,
|
||||||
|
|
||||||
@Inject(DI.userListMembershipsRepository)
|
|
||||||
private userListMembershipsRepository: UserListMembershipsRepository,
|
|
||||||
|
|
||||||
private cacheService: CacheService,
|
|
||||||
private roleService: RoleService,
|
private roleService: RoleService,
|
||||||
private utilityService: UtilityService,
|
private utilityService: UtilityService,
|
||||||
private globalEventService: GlobalEventService,
|
private globalEventService: GlobalEventService,
|
||||||
|
@ -245,6 +241,7 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
caseSensitive: boolean;
|
caseSensitive: boolean;
|
||||||
localOnly?: boolean;
|
localOnly?: boolean;
|
||||||
excludeBots?: boolean;
|
excludeBots?: boolean;
|
||||||
|
excludeNotesInSensitiveChannel?: boolean;
|
||||||
useRegex?: boolean;
|
useRegex?: boolean;
|
||||||
withReplies: boolean;
|
withReplies: boolean;
|
||||||
withFile: boolean;
|
withFile: boolean;
|
||||||
|
@ -272,6 +269,7 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
caseSensitive: ps.caseSensitive,
|
caseSensitive: ps.caseSensitive,
|
||||||
localOnly: ps.localOnly,
|
localOnly: ps.localOnly,
|
||||||
excludeBots: ps.excludeBots,
|
excludeBots: ps.excludeBots,
|
||||||
|
excludeNotesInSensitiveChannel: ps.excludeNotesInSensitiveChannel,
|
||||||
useRegex: ps.useRegex,
|
useRegex: ps.useRegex,
|
||||||
withReplies: ps.withReplies,
|
withReplies: ps.withReplies,
|
||||||
withFile: ps.withFile,
|
withFile: ps.withFile,
|
||||||
|
@ -294,6 +292,7 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
caseSensitive?: boolean;
|
caseSensitive?: boolean;
|
||||||
localOnly?: boolean;
|
localOnly?: boolean;
|
||||||
excludeBots?: boolean;
|
excludeBots?: boolean;
|
||||||
|
excludeNotesInSensitiveChannel?: boolean;
|
||||||
useRegex?: boolean;
|
useRegex?: boolean;
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
withFile?: boolean;
|
withFile?: boolean;
|
||||||
|
@ -328,6 +327,7 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
caseSensitive: ps.caseSensitive,
|
caseSensitive: ps.caseSensitive,
|
||||||
localOnly: ps.localOnly,
|
localOnly: ps.localOnly,
|
||||||
excludeBots: ps.excludeBots,
|
excludeBots: ps.excludeBots,
|
||||||
|
excludeNotesInSensitiveChannel: ps.excludeNotesInSensitiveChannel,
|
||||||
useRegex: ps.useRegex,
|
useRegex: ps.useRegex,
|
||||||
withReplies: ps.withReplies,
|
withReplies: ps.withReplies,
|
||||||
withFile: ps.withFile,
|
withFile: ps.withFile,
|
||||||
|
@ -402,11 +402,11 @@ export class AntennaService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async checkHitAntenna(
|
public checkHitAntenna(
|
||||||
filter: AntennaFilter,
|
filter: AntennaFilter,
|
||||||
note: (MiNote | Packed<'Note'>),
|
note: (MiNote | Packed<'Note'>),
|
||||||
noteUser: { id: MiUser['id']; username: string; host: string | null; isBot: boolean; },
|
noteUser: { id: MiUser['id']; username: string; host: string | null; isBot: boolean; },
|
||||||
): Promise<boolean> {
|
): boolean {
|
||||||
const antenna = filter.src;
|
const antenna = filter.src;
|
||||||
if (antenna.excludeNotesInSensitiveChannel && note.channel?.isSensitive) return false;
|
if (antenna.excludeNotesInSensitiveChannel && note.channel?.isSensitive) return false;
|
||||||
if (antenna.excludeBots && noteUser.isBot) return false;
|
if (antenna.excludeBots && noteUser.isBot) return false;
|
||||||
|
|
Loading…
Reference in New Issue