refresh static method

Future<FeedChannel> refresh(
  1. String channelUrl, {
  2. Chat? chat,
})

Refreshes all the data of this channel. @since 4.0.3

Implementation

static Future<FeedChannel> refresh(
  String channelUrl, {
  Chat? chat,
}) async {
  sbLog.i(StackTrace.current, 'channelUrl: $channelUrl');
  chat ??= SendbirdChat().chat;

  final channel = await chat.apiClient.send<FeedChannel>(
    FeedChannelRefreshRequest(
      chat,
      channelUrl,
      options: [
        ChannelListQueryIncludeOption.includeMember,
        ChannelListQueryIncludeOption.includeMetadata,
        ChannelListQueryIncludeOption.includeReadReceipt,
        ChannelListQueryIncludeOption.includeDeliveryReceipt,
      ],
      passive: false,
    ),
  );

  //+ [DBManager]
  if (chat.dbManager.isEnabled()) {
    await chat.dbManager.upsertFeedChannels([channel]);
  }
  //- [DBManager]

  return channel;
}