Skip to content

Commit 17dbbae

Browse files
compose: Add function to fetch video chat url as per realmVideoChatProvider
1 parent 4e1ca2f commit 17dbbae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/widgets/compose_box.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,11 +1040,26 @@ class _AttachVideoChatUrlButton extends StatelessWidget {
10401040
final ComposeBoxController controller;
10411041
final bool enabled;
10421042

1043+
static const int jitsi = 1;
1044+
static const int zoom = 2; //TODO: Add other supported video chat providers
1045+
10431046
String _generateJitsiUrl(String serverUrl, String visibleText) {
10441047
final id = List.generate(15, (_) => Random.secure().nextInt(10)).join();
10451048
return inlineLink(visibleText, '$serverUrl/$id#config.startWithVideoMuted=false');
10461049
}
10471050

1051+
String? _getMeetingUrl(ZulipLocalizations zulipLocalization, int? provider, String? jitsiServerUrl) {
1052+
final visibleText = zulipLocalization.composeBoxUploadedVideoCallUrl;
1053+
1054+
switch (provider) {
1055+
case 0: return null; //TODO: Implement feedback no video chat provider is setup
1056+
case jitsi: return jitsiServerUrl == null ? null :_generateJitsiUrl(jitsiServerUrl, visibleText);
1057+
case zoom: return inlineLink(visibleText,
1058+
'https://zoom.us/start/meeting');
1059+
default: return null;
1060+
}
1061+
}
1062+
10481063
void _handlePress(BuildContext context) {
10491064
}
10501065

0 commit comments

Comments
 (0)