redactEvent method
Redacts this event. Throws ErrorResponse
on error.
Implementation
Future<String?> redactEvent(String eventId,
{String? reason, String? txid}) async {
// Create new transaction id
String messageID;
final now = DateTime.now().millisecondsSinceEpoch;
if (txid == null) {
messageID = 'msg$now';
} else {
messageID = txid;
}
final data = <String, dynamic>{};
if (reason != null) data['reason'] = reason;
return await client.redactEvent(
id,
eventId,
messageID,
reason: reason,
);
}