[LLC -> Client] Expose queryChannelsOnline and queryChannelsOffline
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -491,7 +491,7 @@ class StreamChatClient {
|
|||||||
|
|
||||||
if (status == ConnectionStatus.connected &&
|
if (status == ConnectionStatus.connected &&
|
||||||
state.channels?.isNotEmpty == true) {
|
state.channels?.isNotEmpty == true) {
|
||||||
unawaited(_queryChannels(filter: {
|
unawaited(queryChannelsOnline(filter: {
|
||||||
'cid': {
|
'cid': {
|
||||||
'\$in': state.channels.keys.toList(),
|
'\$in': state.channels.keys.toList(),
|
||||||
},
|
},
|
||||||
@@ -615,7 +615,7 @@ class StreamChatClient {
|
|||||||
yield await _queryChannelsStreams[hash];
|
yield await _queryChannelsStreams[hash];
|
||||||
} else {
|
} else {
|
||||||
if (true) {
|
if (true) {
|
||||||
final channels = await _queryChannelsOffline(
|
final channels = await queryChannelsOffline(
|
||||||
filter: filter,
|
filter: filter,
|
||||||
sort: sort,
|
sort: sort,
|
||||||
paginationParams: paginationParams,
|
paginationParams: paginationParams,
|
||||||
@@ -623,7 +623,7 @@ class StreamChatClient {
|
|||||||
if (channels.isNotEmpty) yield channels;
|
if (channels.isNotEmpty) yield channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
final newQueryChannelsFuture = _queryChannels(
|
final newQueryChannelsFuture = queryChannelsOnline(
|
||||||
filter: filter,
|
filter: filter,
|
||||||
sort: sort,
|
sort: sort,
|
||||||
options: options,
|
options: options,
|
||||||
@@ -637,7 +637,8 @@ class StreamChatClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Channel>> _queryChannels({
|
/// Requests channels with a given query from the API.
|
||||||
|
Future<List<Channel>> queryChannelsOnline({
|
||||||
@required Map<String, dynamic> filter,
|
@required Map<String, dynamic> filter,
|
||||||
List<SortOption<ChannelModel>> sort,
|
List<SortOption<ChannelModel>> sort,
|
||||||
Map<String, dynamic> options,
|
Map<String, dynamic> options,
|
||||||
@@ -712,7 +713,8 @@ class StreamChatClient {
|
|||||||
return updateData.value;
|
return updateData.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Channel>> _queryChannelsOffline({
|
/// Requests channels with a given query from the Persistence client.
|
||||||
|
Future<List<Channel>> queryChannelsOffline({
|
||||||
@required Map<String, dynamic> filter,
|
@required Map<String, dynamic> filter,
|
||||||
@required List<SortOption<ChannelModel>> sort,
|
@required List<SortOption<ChannelModel>> sort,
|
||||||
PaginationParams paginationParams = const PaginationParams(limit: 10),
|
PaginationParams paginationParams = const PaginationParams(limit: 10),
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ abstract class ChatPersistenceClient {
|
|||||||
getReadsByCid(cid),
|
getReadsByCid(cid),
|
||||||
getChannelByCid(cid),
|
getChannelByCid(cid),
|
||||||
getMessagesByCid(cid, messagePagination: messagePagination),
|
getMessagesByCid(cid, messagePagination: messagePagination),
|
||||||
getPinnedMessagesByCid(cid,messagePagination: pinnedMessagePagination),
|
getPinnedMessagesByCid(cid, messagePagination: pinnedMessagePagination),
|
||||||
]);
|
]);
|
||||||
return ChannelState(
|
return ChannelState(
|
||||||
members: data[0],
|
members: data[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user