cherry picked wildcard antennas
Some checks failed
Lint / pnpm_install (pull_request) Successful in 2m44s
Test (backend) / unit (22.x) (pull_request) Successful in 7m25s
Test (frontend) / vitest (22.x) (pull_request) Successful in 2m52s
Test (backend) / e2e (22.x) (pull_request) Failing after 9m55s
Test (production install and build) / production (22.x) (pull_request) Successful in 3m50s
Test (backend) / validate-api-json (22.x) (pull_request) Successful in 4m40s
Lint / lint (backend) (pull_request) Successful in 7m32s
Lint / lint (misskey-js) (pull_request) Successful in 2m36s
Lint / lint (sw) (pull_request) Successful in 2m25s
Lint / lint (frontend) (pull_request) Successful in 11m40s
Lint / typecheck (misskey-js) (pull_request) Successful in 5m14s
Lint / typecheck (backend) (pull_request) Successful in 9m6s

This commit is contained in:
Leah 2025-01-19 20:34:07 +01:00
parent 9dbb4124da
commit 3f6f1d2e9d
3 changed files with 8 additions and 4 deletions

View file

@ -417,7 +417,7 @@ antennaKeywordsDescription: "Separate with spaces for an AND condition or with l
notifyAntenna: "Notify about new notes" notifyAntenna: "Notify about new notes"
withFileAntenna: "Only notes with files" withFileAntenna: "Only notes with files"
enableServiceworker: "Enable Push-Notifications for your Browser" enableServiceworker: "Enable Push-Notifications for your Browser"
antennaUsersDescription: "List one username per line" antennaUsersDescription: "List one username per line. Use \"*@instance.com\" to specify all users of an instance"
caseSensitive: "Case sensitive" caseSensitive: "Case sensitive"
withReplies: "Include replies" withReplies: "Include replies"
connectedTo: "Following account(s) are connected" connectedTo: "Following account(s) are connected"

View file

@ -405,7 +405,7 @@ antennaKeywordsDescription: "Separar con espacios es una declaración AND, separ
notifyAntenna: "Notificar nueva nota" notifyAntenna: "Notificar nueva nota"
withFileAntenna: "Sólo notas con archivos adjuntados" withFileAntenna: "Sólo notas con archivos adjuntados"
enableServiceworker: "Activar ServiceWorker" enableServiceworker: "Activar ServiceWorker"
antennaUsersDescription: "Elegir nombres de usuarios separados por una linea nueva" antennaUsersDescription: "Elegir nombres de usuarios separados por una linea nueva. Utilice \"*@instance.com\" para especificar todos los usuarios de una instancia."
caseSensitive: "Distinguir mayúsculas de minúsculas" caseSensitive: "Distinguir mayúsculas de minúsculas"
withReplies: "Incluir respuestas" withReplies: "Incluir respuestas"
connectedTo: "Estas cuentas están conectadas" connectedTo: "Estas cuentas están conectadas"

View file

@ -147,13 +147,17 @@ export class AntennaService implements OnApplicationShutdown {
const { username, host } = Acct.parse(x); const { username, host } = Acct.parse(x);
return this.utilityService.getFullApAccount(username, host).toLowerCase(); return this.utilityService.getFullApAccount(username, host).toLowerCase();
}); });
if (!accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; const matchUser = this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase();
const matchWildcard = this.utilityService.getFullApAccount('*', noteUser.host).toLowerCase();
if (!accts.includes(matchUser) && !accts.includes(matchWildcard)) return false;
} else if (antenna.src === 'users_blacklist') { } else if (antenna.src === 'users_blacklist') {
const accts = antenna.users.map(x => { const accts = antenna.users.map(x => {
const { username, host } = Acct.parse(x); const { username, host } = Acct.parse(x);
return this.utilityService.getFullApAccount(username, host).toLowerCase(); return this.utilityService.getFullApAccount(username, host).toLowerCase();
}); });
if (accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; const matchUser = this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase();
const matchWildcard = this.utilityService.getFullApAccount('*', noteUser.host).toLowerCase();
if (accts.includes(matchUser) || accts.includes(matchWildcard)) return false;
} }
const keywords = antenna.keywords const keywords = antenna.keywords