deleteConversation static method

Future<V2TimCallback> deleteConversation({
  1. required String conversationID,
})

Implementation

static Future<V2TimCallback> deleteConversation({
  required String conversationID,
}) async {
  String userData = Tools.generateUserData();
  Pointer<Uint8> user_data = Tools.string2PointerInt8(userData);
  Pointer<Uint8> conv_id = Tools.string2PointerInt8(Tools.nativecidtoCcid(conversationID));
  int conv_type = Tools.convertid2convType(conversationID);

  int res = desktopSDK.D_TIMConvDelete(conv_id, conv_type, user_data);

  if (res != TIMResult.TIM_SUCC) {
    return V2TimCallback.fromJson({
      "code": res,
      "desc": "",
    });
  } else {
    Map<String, dynamic> data = await getAsyncData(apiKey: userData);
    return V2TimCallback.fromJson({
      "code": data["code"],
      "desc": data["desc"],
    });
  }
}