fix: voip code breaking from 0.28

have not tested it but should mostly be fine, rewrite should get in someday anyway :p
This commit is contained in:
td 2024-04-30 18:19:10 +05:30
commit 4095560412
No known key found for this signature in database
GPG key ID: 62A30523D4D6CE28
10 changed files with 124 additions and 115 deletions

View file

@ -1269,25 +1269,12 @@ class ChatController extends State<ChatPageWithRoom>
);
if (callType == null) return;
final success = await showFutureLoadingDialog(
context: context,
future: () =>
Matrix.of(context).voipPlugin!.voip.requestTurnServerCredentials(),
);
if (success.result != null) {
final voipPlugin = Matrix.of(context).voipPlugin;
try {
await voipPlugin!.voip.inviteToCall(room.id, callType);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toLocalizedString(context))),
);
}
} else {
await showOkAlertDialog(
context: context,
title: L10n.of(context)!.unavailable,
okLabel: L10n.of(context)!.next,
final voipPlugin = Matrix.of(context).voipPlugin;
try {
await voipPlugin!.voip.inviteToCall(room, callType);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toLocalizedString(context))),
);
}
}