redact method

Future<EventId> redact(
  1. String attachmentId,
  2. String? reason,
  3. String? txnId
)

Implementation

Future<EventId> redact(
  String attachmentId,
  String? reason,
  String? txnId,
) {
  final tmp1 = attachmentId;
  final tmp5 = reason;
  final tmp11 = txnId;
  var tmp0 = 0;
  var tmp2 = 0;
  var tmp3 = 0;
  var tmp4 = 0;
  var tmp6 = 0;
  var tmp8 = 0;
  var tmp9 = 0;
  var tmp10 = 0;
  var tmp12 = 0;
  var tmp14 = 0;
  var tmp15 = 0;
  var tmp16 = 0;
  tmp0 = _box.borrow();
  final tmp1_0 = utf8.encode(tmp1);
  tmp3 = tmp1_0.length;

  final ffi.Pointer<ffi.Uint8> tmp2_0 = _api.__allocate(tmp3 * 1, 1);
  final Uint8List tmp2_1 = tmp2_0.asTypedList(tmp3);
  tmp2_1.setAll(0, tmp1_0);
  tmp2 = tmp2_0.address;
  tmp4 = tmp3;
  if (tmp5 == null) {
    tmp6 = 0;
  } else {
    tmp6 = 1;
    final tmp7 = tmp5;
    final tmp7_0 = utf8.encode(tmp7);
    tmp9 = tmp7_0.length;

    final ffi.Pointer<ffi.Uint8> tmp8_0 = _api.__allocate(tmp9 * 1, 1);
    final Uint8List tmp8_1 = tmp8_0.asTypedList(tmp9);
    tmp8_1.setAll(0, tmp7_0);
    tmp8 = tmp8_0.address;
    tmp10 = tmp9;
  }
  if (tmp11 == null) {
    tmp12 = 0;
  } else {
    tmp12 = 1;
    final tmp13 = tmp11;
    final tmp13_0 = utf8.encode(tmp13);
    tmp15 = tmp13_0.length;

    final ffi.Pointer<ffi.Uint8> tmp14_0 = _api.__allocate(tmp15 * 1, 1);
    final Uint8List tmp14_1 = tmp14_0.asTypedList(tmp15);
    tmp14_1.setAll(0, tmp13_0);
    tmp14 = tmp14_0.address;
    tmp16 = tmp15;
  }
  final tmp17 = _api._attachmentsManagerRedact(
    tmp0,
    tmp2,
    tmp3,
    tmp4,
    tmp6,
    tmp8,
    tmp9,
    tmp10,
    tmp12,
    tmp14,
    tmp15,
    tmp16,
  );
  final tmp19 = tmp17;
  final ffi.Pointer<ffi.Void> tmp19_0 = ffi.Pointer.fromAddress(tmp19);
  final tmp19_1 =
      _Box(_api, tmp19_0, "__AttachmentsManager_redact_future_drop");
  tmp19_1._finalizer = _api._registerFinalizer(tmp19_1);
  final tmp18 =
      _nativeFuture(tmp19_1, _api.__attachmentsManagerRedactFuturePoll);
  return tmp18;
}