Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

feat(search): accept user IDs in from and mentions filters (#1663)

Hampus162937575cf5
diff --git a/fluxer_app/src/features/search/utils/SearchQueryParser.ts b/fluxer_app/src/features/search/utils/SearchQueryParser.ts
index 6cd307b27..69b56ae78 100644
--- a/fluxer_app/src/features/search/utils/SearchQueryParser.ts
+++ b/fluxer_app/src/features/search/utils/SearchQueryParser.ts
@@ -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();
}