mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(search): accept user IDs in from and mentions filters (#1663)
This commit is contained in:
1 parent
c6223d656e
commit
162937575c
1 file changed
+4
-1
@@ -4,7 +4,7 @@ import Channels from '@app/features/channel/state/Channels';
|
||||
import type {MessageSearchParams} from '@app/features/search/utils/SearchUtils';
|
||||
import Users from '@app/features/user/state/Users';
|
||||
import {MS_PER_DAY, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND} from '@fluxer/date_utils/src/DateConstants';
|
||||
import {fromTimestamp} from '@fluxer/snowflake/src/SnowflakeUtils';
|
||||
import {fromTimestamp, isProbablyAValidSnowflake} from '@fluxer/snowflake/src/SnowflakeUtils';
|
||||
import {DateTime} from 'luxon';
|
||||
|
||||
export interface ParserContext {
|
||||
@@ -280,6 +280,9 @@ const tryResolveUser = (tag: string, hints?: SearchHints): string | null => {
|
||||
if (!trimmedTag) {
|
||||
return null;
|
||||
}
|
||||
if (isProbablyAValidSnowflake(trimmedTag)) {
|
||||
return trimmedTag;
|
||||
}
|
||||
if (isCurrentUserToken(trimmedTag)) {
|
||||
return getCurrentUserId();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user