Add hashtag awareness to friendica search client

merge-requests/67/head
Hank Grabowski 2024-12-21 21:35:17 -05:00
rodzic 71e83ab824
commit 71a15990e2
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -45,8 +45,14 @@ Future<Result<PagedResponse<SearchResults>, ExecError>> searchResults(
Future.microtask( Future.microtask(
() async => ref.read(searchLoadingStatusProvider(profile).notifier).begin(), () async => ref.read(searchLoadingStatusProvider(profile).notifier).begin(),
); );
var query = searchTerm.trim();
// query sanitazation?
if (query.startsWith('#')) {
query.replaceFirst('#', '%23');
}
final url = final url =
'https://${profile.serverName}/api/v1/search?${page.toQueryParameters()}&${type.toQueryParameters()}&q=$searchTerm'; 'https://${profile.serverName}/api/v1/search?${page.toQueryParameters()}&${type.toQueryParameters()}&q=$query';
final result = await ref.read(getApiPagedRequestProvider( final result = await ref.read(getApiPagedRequestProvider(
profile, profile,
Uri.parse(url), Uri.parse(url),

Wyświetl plik

@ -6,7 +6,7 @@ part of 'friendica_search_client_services.dart';
// RiverpodGenerator // RiverpodGenerator
// ************************************************************************** // **************************************************************************
String _$searchResultsHash() => r'c7aad55fce75888433ef6afd35ffcd88d7d5b8c4'; String _$searchResultsHash() => r'56bb101341f50f55e152908e1f3aabf25e842cb4';
/// Copied from Dart SDK /// Copied from Dart SDK
class _SystemHash { class _SystemHash {