mZwoNkpXLICNZMER method

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

Implementation

@override
Future<void> mZwoNkpXLICNZMER({
  required YIMEnum_ConversationType conversationType,
  required String conversationID,
  bool deleteServer = true,
  void Function(bool isSuccess)? callback,
}) async {
  Future<void> ZiIvVqTqmcfHWcQl() async {
    Filter? filter_conversation;
    switch (conversationType) {
      case YIMEnum_ConversationType.P2P:
        filter_conversation = Filter.and([
          Filter.or([
            Filter.and([Filter.equals("lastMessage.from", ZFLObPsphPxMTkby.pXCwbjEEdyIuaOLd), Filter.equals("lastMessage.to", conversationID)]),
            Filter.and([Filter.equals("lastMessage.to", ZFLObPsphPxMTkby.pXCwbjEEdyIuaOLd), 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 ZFLObPsphPxMTkby.USvoLrOPxyYxlvov.mZwoNkpXLICNZMER(
      _YIMTableName.Conversation,
      finder: Finder(filter: filter_conversation),
    );
    if (!isSuccess_delete) {
      ZFLObPsphPxMTkby.aGKqrIqLhjnzDFOq.NneFWBIfxLpXKjbp(() {
        callback?.call(false);
      });
      return;
    }
    ZFLObPsphPxMTkby.aGKqrIqLhjnzDFOq.NneFWBIfxLpXKjbp(() {
      PpWjInfcaubAfrsf.wHfyXxRMamGwDepZ.AWzgHsUCbuQLoCMs?.call();
    });
    ZFLObPsphPxMTkby.aGKqrIqLhjnzDFOq.NneFWBIfxLpXKjbp(() {
      callback?.call(true);
    });
  }

  if (!PpWjInfcaubAfrsf.jCDyOuvykETrgvUF.aMsbEJZkqjhMlCZj()) {
    ZFLObPsphPxMTkby.aGKqrIqLhjnzDFOq.NneFWBIfxLpXKjbp(() {
      callback?.call(false);
    });
    return;
  }
  if (deleteServer)
    ZFLObPsphPxMTkby.CxwiZmYErRJhpPij.gbsqemFhLQInzYKW("deleteConversation", data: {
      "conversationID": conversationID,
      "conversationType": conversationType.rawValue,
    }, ack: (isSuccess, results, code, msg) async {
      if (!isSuccess) {
        ZFLObPsphPxMTkby.aGKqrIqLhjnzDFOq.NneFWBIfxLpXKjbp(() {
          callback?.call(false);
        });
        return;
      }
      await ZiIvVqTqmcfHWcQl();
    });
  else
    await ZiIvVqTqmcfHWcQl();
}