File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ class NarrowLink extends InternalLink {
133133/// The structure mirrors the data required for [getFileTemporaryUrl] : 
134134///   https://zulip.com/api/get-file-temporary-url 
135135class  UserUploadLink  extends  InternalLink  {
136-   UserUploadLink (this .realmId, this .path , {required  super .realmUrl});
136+   UserUploadLink (this .realmId, this .pathRest , {required  super .realmUrl});
137137
138138  static  UserUploadLink ?  _tryParse (String  urlPath, Uri  realmUrl) {
139139    final  match =  _urlPathRegexp.matchAsPrefix (urlPath);
@@ -145,6 +145,8 @@ class UserUploadLink extends InternalLink {
145145  static  const  _urlPathPrefix =  '/user_uploads/' ;
146146  static  final  _urlPathRegexp =  RegExp (r'^/user_uploads/(\d+)/(.+)$' );
147147
148+   String  get  urlPath =>  '/user_uploads/$realmId /$pathRest ' ;
149+ 
148150  final  int  realmId;
149151
150152  /// The remaining path components after the realm ID. 
@@ -155,7 +157,7 @@ class UserUploadLink extends InternalLink {
155157  /// This corresponds to `filename`  in the arguments to [getFileTemporaryUrl] ; 
156158  /// but it's typically several path components, 
157159  /// not just one as that name would suggest. 
158- final  String  path ;
160+ final  String  pathRest ;
159161}
160162
161163/// Try to parse the given URL as a page in this app, on `store` 's realm. 
Original file line number Diff line number Diff line change @@ -608,8 +608,7 @@ void main() {
608608        } else  {
609609          check (result).isA <UserUploadLink >();
610610          result as  UserUploadLink ;
611-           final  reconstructedPath =  '/user_uploads/${result .realmId }/${result .path }' ;
612-           check (reconstructedPath).equals (urlPath);
611+           check (result.urlPath).equals (urlPath); // TODO checks-getter 
613612        }
614613      });
615614    }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments