File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1040,7 +1040,33 @@ 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+ 
1046+   String  _generateJitsiUrl (String  serverUrl, String  visibleText) {
1047+     final  id =  List .generate (15 , (_) =>  Random .secure ().nextInt (10 )).join ();
1048+     return  inlineLink (visibleText, '$serverUrl /$id #config.startWithVideoMuted=false' );
1049+   }
1050+ 
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+ 
10431063  void  _handlePress (BuildContext  context) {
1064+     final  store =  PerAccountStoreWidget .of (context);
1065+     final  zulipLocalizations =  ZulipLocalizations .of (context);
1066+ 
1067+     final  placeholder =  _getMeetingUrl (zulipLocalizations,
1068+         store.realmVideoChatProvider, store.jitsiServerUrl);
1069+     if  (placeholder ==  null ) return ;
10441070  }
10451071
10461072  @override 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments