summaryrefslogtreecommitdiff
path: root/src/client/scripts/gen-search-query.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-11-12 02:02:25 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-11-12 02:02:25 +0900
commit0e4a111f81cceed275d9bec2695f6e401fb654d8 (patch)
tree40874799472fa07416f17b50a398ac33b7771905 /src/client/scripts/gen-search-query.ts
parentupdate deps (diff)
downloadmisskey-0e4a111f81cceed275d9bec2695f6e401fb654d8.tar.gz
misskey-0e4a111f81cceed275d9bec2695f6e401fb654d8.tar.bz2
misskey-0e4a111f81cceed275d9bec2695f6e401fb654d8.zip
refactoring
Resolve #7779
Diffstat (limited to 'src/client/scripts/gen-search-query.ts')
-rw-r--r--src/client/scripts/gen-search-query.ts31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/client/scripts/gen-search-query.ts b/src/client/scripts/gen-search-query.ts
deleted file mode 100644
index cafb3cccfe..0000000000
--- a/src/client/scripts/gen-search-query.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { parseAcct } from '@/misc/acct';
-import { host as localHost } from '@client/config';
-
-export async function genSearchQuery(v: any, q: string) {
- let host: string;
- let userId: string;
- if (q.split(' ').some(x => x.startsWith('@'))) {
- for (const at of q.split(' ').filter(x => x.startsWith('@')).map(x => x.substr(1))) {
- if (at.includes('.')) {
- if (at === localHost || at === '.') {
- host = null;
- } else {
- host = at;
- }
- } else {
- const user = await v.os.api('users/show', parseAcct(at)).catch(x => null);
- if (user) {
- userId = user.id;
- } else {
- // todo: show error
- }
- }
- }
-
- }
- return {
- query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '),
- host: host,
- userId: userId
- };
-}