mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 06:36:58 +02:00
Handle a connection issue when we try to start a new voice broadcast (#7276)
This commit is contained in:
@@ -2454,13 +2454,19 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
// Prevents listening a VB when recording a new one
|
||||
[VoiceBroadcastPlaybackProvider.shared pausePlaying];
|
||||
|
||||
// Check connectivity
|
||||
if ([AppDelegate theDelegate].isOffline)
|
||||
{
|
||||
[self showAlertWithTitle:[VectorL10n voiceBroadcastConnectionErrorTitle] message:[VectorL10n voiceBroadcastConnectionErrorMessage]];
|
||||
return;
|
||||
}
|
||||
|
||||
// Request the voice broadcast service to start recording - No service is returned if someone else is already broadcasting in the room
|
||||
[session getOrCreateVoiceBroadcastServiceFor:self.roomDataSource.room completion:^(VoiceBroadcastService *voiceBroadcastService) {
|
||||
if (voiceBroadcastService) {
|
||||
[voiceBroadcastService startVoiceBroadcastWithSuccess:^(NSString * _Nullable success) {
|
||||
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
[voiceBroadcastService startVoiceBroadcastWithSuccess:^(NSString * _Nullable success) { } failure:^(NSError * _Nonnull error) {
|
||||
[self showAlertWithTitle:[VectorL10n voiceBroadcastConnectionErrorTitle] message:[VectorL10n voiceBroadcastConnectionErrorMessage]];
|
||||
[session tearDownVoiceBroadcastService];
|
||||
}];
|
||||
}
|
||||
else
|
||||
|
||||
@@ -186,7 +186,7 @@ public class VoiceBroadcastService: NSObject {
|
||||
return
|
||||
}
|
||||
|
||||
self.room.sendStateEvent(.custom(VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType),
|
||||
let httpOperation = self.room.sendStateEvent(.custom(VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType),
|
||||
content: stateEventContent, stateKey: stateKey) { [weak self] response in
|
||||
guard let self = self else { return }
|
||||
|
||||
@@ -199,6 +199,9 @@ public class VoiceBroadcastService: NSObject {
|
||||
}
|
||||
taskCompleted()
|
||||
}
|
||||
|
||||
// No retry to send the request
|
||||
httpOperation.maxNumberOfTries = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user