setC2CReceiveMessageOpt method

Future<V2TimCallback> setC2CReceiveMessageOpt({
  1. required List<String> userIDList,
  2. required int opt,
})

Implementation

Future<V2TimCallback> setC2CReceiveMessageOpt({
  required List<String> userIDList,
  required int opt,
}) async {
  try {
    final remindTypeOpt = {'userIDList': userIDList, 'messageRemindType': GroupRecvMsgOpt.convertMsgRecvOptToWeb(opt)};
    final res = await wrappedPromiseToFuture(timeweb!.setMessageRemindType(mapToJSObj(remindTypeOpt)));
    if (res.code == 0) {
      return CommonUtils.returnSuccessForCb(jsToMap(res.data));
    } else {
      return CommonUtils.returnError('set group recv msg opt failed');
    }
  } catch (error) {
    return CommonUtils.returnError(error);
  }
}