mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-01-10 15:40:57 -07:00
[backend] Add instance:local postgres FTS filter
This commit is contained in:
parent
e1ae37dbdb
commit
98f40d8865
2 changed files with 10 additions and 6 deletions
|
@ -134,8 +134,12 @@ function afterFilter(query: SelectQueryBuilder<any>, filter: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function instanceFilter(query: SelectQueryBuilder<any>, filter: string, id: number) {
|
function instanceFilter(query: SelectQueryBuilder<any>, filter: string, id: number) {
|
||||||
query.andWhere(`note.userHost = :instance_${id}`);
|
if (filter === 'local') {
|
||||||
query.setParameter(`instance_${id}`, filter);
|
query.andWhere(`note.userHost IS NULL`);
|
||||||
|
} else {
|
||||||
|
query.andWhere(`note.userHost = :instance_${id}`);
|
||||||
|
query.setParameter(`instance_${id}`, filter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function instanceFilterInverse(query: SelectQueryBuilder<any>, filter: string, id: number) {
|
function instanceFilterInverse(query: SelectQueryBuilder<any>, filter: string, id: number) {
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
<div class="section _block">
|
<div class="section _block">
|
||||||
<div class="title">{{ i18n.ts._filters._dialog.userDomain }}</div>
|
<div class="title">{{ i18n.ts._filters._dialog.userDomain }}</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p><code>[-]from:[@]user[@host.tld]</code></p>
|
<p><code>[-]from:[@]user[@domain.tld]</code></p>
|
||||||
<p><code>[-]mention:[@]user[@host.tld]</code></p>
|
<p><code>[-]mention:[@]user[@domain.tld]</code></p>
|
||||||
<p><code>[-]reply:[@]user[@host.tld]</code></p>
|
<p><code>[-]reply:[@]user[@domain.tld]</code></p>
|
||||||
<p><code>[-]instance:domain.tld</code></p>
|
<p><code>[-]instance:local|domain.tld</code></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section _block">
|
<div class="section _block">
|
||||||
|
|
Loading…
Reference in a new issue