deleteAllMetaData method

Future<void> deleteAllMetaData()

Deletes all meta data.

Implementation

Future<void> deleteAllMetaData() async {
  sbLog.i(StackTrace.current);
  checkUnsupportedAction();

  final ts = await chat.apiClient.send<int>(
    ChannelMetaDataDeleteAllRequest(
      chat,
      channelType: channelType,
      channelUrl: channelUrl,
    ),
  );

  final cached =
      chat.channelCache.find<MetaDataCache>(channelKey: channelUrl) ??
          MetaDataCache<String>(
            channelType: channelType,
            channelUrl: channelUrl,
            timestamp: ts,
          );
  cached.removeAll(ts);
  cached.saveToCache(chat);
}