botSyNFICqxYVBha method

  1. @override
Future<void> botSyNFICqxYVBha({
  1. required YIMEnum_ConversationType conversationType,
  2. required String conversationID,
  3. bool deleteServer = true,
  4. void callback(
    1. bool isSuccess
    )?,
})
override

Implementation

@override
Future<void> botSyNFICqxYVBha({
  required YIMEnum_ConversationType conversationType,
  required String conversationID,
  bool deleteServer = true,
  void Function(bool isSuccess)? callback,
}) async {
  Future<void> uCpKBKKvaKSiweRC() async {
    Filter? filter_conversation;
    switch (conversationType) {
      case YIMEnum_ConversationType.P2P:
        filter_conversation = Filter.and([
          Filter.or([
            Filter.and([Filter.equals("lastMessage.from", ChHWxkNyIYdGPgIp.ksamNgiJbtTkgWGM), Filter.equals("lastMessage.to", conversationID)]),
            Filter.and([Filter.equals("lastMessage.to", ChHWxkNyIYdGPgIp.ksamNgiJbtTkgWGM), Filter.equals("lastMessage.from", conversationID)]),
          ]),
          Filter.equals("lastMessage.conversationType", conversationType.rawValue),
        ]);
        break;
      case YIMEnum_ConversationType.Team:
        filter_conversation = Filter.and([
          Filter.equals("lastMessage.to", conversationID),
          Filter.equals("lastMessage.conversationType", conversationType.rawValue),
        ]);
        break;
    }
    final isSuccess_delete = await ChHWxkNyIYdGPgIp.AfmWLjSfbSyvnnbs.botSyNFICqxYVBha(
      _YIMTableName.Conversation,
      finder: Finder(filter: filter_conversation),
    );
    if (!isSuccess_delete) {
      ChHWxkNyIYdGPgIp.bcTNsdWUkvsNvNtA.hyhgjgkolDqewEJe(() {
        callback?.call(false);
      });
      return;
    }
    ChHWxkNyIYdGPgIp.bcTNsdWUkvsNvNtA.hyhgjgkolDqewEJe(() {
      XHsRQRNOuwGZsfbv.MVIUliHVbEMrNxar.PGOBwkzlmTdqnLuq?.call();
    });
    ChHWxkNyIYdGPgIp.bcTNsdWUkvsNvNtA.hyhgjgkolDqewEJe(() {
      callback?.call(true);
    });
  }

  if (!XHsRQRNOuwGZsfbv.mPWMdbNwLIyoBgrJ.LtVYzmOKJtheTMIO()) {
    ChHWxkNyIYdGPgIp.bcTNsdWUkvsNvNtA.hyhgjgkolDqewEJe(() {
      callback?.call(false);
    });
    return;
  }
  if (deleteServer)
    ChHWxkNyIYdGPgIp.TVCJXxyfIfYciKui.wzprQihVzseBAphn("deleteConversation", data: {
      "conversationID": conversationID,
      "conversationType": conversationType.rawValue,
    }, ack: (isSuccess, results, code, msg) async {
      if (!isSuccess) {
        ChHWxkNyIYdGPgIp.bcTNsdWUkvsNvNtA.hyhgjgkolDqewEJe(() {
          callback?.call(false);
        });
        return;
      }
      await uCpKBKKvaKSiweRC();
    });
  else
    await uCpKBKKvaKSiweRC();
}