Compare commits

...

4 commits

Author SHA1 Message Date
Amelia Yukii
4a54ece4dd merge: Draft: feat: allow using wildcards in antenna (!114)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/114
2024-04-04 00:19:24 +00:00
Marie
8c955fcce5 merge: use correct note design in favorites page - fixes #483 (!481)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/481

Closes #483

Approved-by: Amelia Yukii <amelia.yukii@shourai.de>
Approved-by: Marie <marie@kaifa.ch>
2024-04-03 09:28:01 +00:00
dakkar
bd7c4f66f3 use correct note design in favorites page - fixes #483 2024-03-27 16:03:35 +00:00
Kaity A
14a9e1050b
feat: allow using wildcards in antenna 2023-10-24 21:16:09 +10:00
5 changed files with 16 additions and 7 deletions

View file

@ -415,7 +415,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

@ -404,7 +404,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

@ -131,13 +131,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

View file

@ -55,8 +55,6 @@ import { i18n } from '@/i18n.js';
import { infoImageUrl } from '@/instance.js'; import { infoImageUrl } from '@/instance.js';
import { defaultStore } from '@/store.js'; import { defaultStore } from '@/store.js';
console.log(defaultStore.state.noteDesign, defaultStore.state.noteDesign === 'sharkey');
const props = defineProps<{ const props = defineProps<{
pagination: Paging; pagination: Paging;
noGap?: boolean; noGap?: boolean;

View file

@ -16,9 +16,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<template #default="{ items }"> <template #default="{ items }">
<MkDateSeparatedList v-slot="{ item }" :items="items" :direction="'down'" :noGap="false" :ad="false"> <MkDateSeparatedList v-if="defaultStore.state.noteDesign === 'misskey'"
v-slot="{ item }" :items="items" :direction="'down'" :noGap="false" :ad="false">
<MkNote :key="item.id" :note="item.note" :class="$style.note"/> <MkNote :key="item.id" :note="item.note" :class="$style.note"/>
</MkDateSeparatedList> </MkDateSeparatedList>
<MkDateSeparatedList v-if="defaultStore.state.noteDesign === 'sharkey'"
v-slot="{ item }" :items="items" :direction="'down'" :noGap="false" :ad="false">
<SkNote :key="item.id" :note="item.note" :class="$style.note"/>
</MkDateSeparatedList>
</template> </template>
</MkPagination> </MkPagination>
</MkSpacer> </MkSpacer>
@ -28,10 +33,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import MkPagination from '@/components/MkPagination.vue'; import MkPagination from '@/components/MkPagination.vue';
import MkNote from '@/components/MkNote.vue'; import MkNote from '@/components/MkNote.vue';
import SkNote from '@/components/SkNote.vue';
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
import { infoImageUrl } from '@/instance.js'; import { infoImageUrl } from '@/instance.js';
import { defaultStore } from '@/store.js';
const pagination = { const pagination = {
endpoint: 'i/favorites' as const, endpoint: 'i/favorites' as const,