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,18 +4302,36 @@ static CGSize kThreadListBarButtonItemImageSize;
|
|||
|
||||
[self startActivityIndicator];
|
||||
|
||||
MXWeakify(self);
|
||||
[self.roomDataSource.room redactEvent:selectedEvent.eventId 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];
|
||||
}];
|
||||
// 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);
|
||||
[self.roomDataSource.room redactEvent:selectedEvent.eventId 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];
|
||||
}];
|
||||
}
|
||||
}]];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue