mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Delete a voice broadcast with all related events if MSC3912 is supported.
This commit is contained in:
parent
fdf1839b12
commit
37bd17798c
1 changed files with 30 additions and 12 deletions
|
@ -4302,6 +4302,23 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||||
|
|
||||||
[self startActivityIndicator];
|
[self startActivityIndicator];
|
||||||
|
|
||||||
|
// If it's a voice broadcast, delete the selected event and all related events (only if this feature is supported).
|
||||||
|
BOOL supportsRedactionWithRelations = self.mainSession.store.supportedMatrixVersions.supportsRedactionWithRelations || self.mainSession.store.supportedMatrixVersions.supportsRedactionWithRelationsUnstable;
|
||||||
|
if (supportsRedactionWithRelations && selectedEvent.eventType == MXEventTypeCustom && [selectedEvent.type isEqualToString:VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType]) {
|
||||||
|
MXWeakify(self);
|
||||||
|
[self.roomDataSource.room redactEvent:selectedEvent.eventId withRelations:@[MXEventRelationTypeReference] reason:nil success:^{
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
[self stopActivityIndicator];
|
||||||
|
} failure:^(NSError *error) {
|
||||||
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
[self stopActivityIndicator];
|
||||||
|
|
||||||
|
MXLogDebug(@"[RoomVC] Redact event (%@) failed", selectedEvent.eventId);
|
||||||
|
//Alert user
|
||||||
|
[self showError:error];
|
||||||
|
}];
|
||||||
|
|
||||||
|
} else {
|
||||||
MXWeakify(self);
|
MXWeakify(self);
|
||||||
[self.roomDataSource.room redactEvent:selectedEvent.eventId reason:nil success:^{
|
[self.roomDataSource.room redactEvent:selectedEvent.eventId reason:nil success:^{
|
||||||
MXStrongifyAndReturnIfNil(self);
|
MXStrongifyAndReturnIfNil(self);
|
||||||
|
@ -4314,6 +4331,7 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||||
//Alert user
|
//Alert user
|
||||||
[self showError:error];
|
[self showError:error];
|
||||||
}];
|
}];
|
||||||
|
}
|
||||||
}]];
|
}]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue