@ -6,6 +6,8 @@
 
			
		
	
		
		
			
				
					
					#import  < AVFoundation / AVFoundation . h > 
#import  < AVFoundation / AVFoundation . h > 
 
			
		
	
		
		
			
				
					
					#import  < YapDatabase / YapDatabaseTransaction . h > 
#import  < YapDatabase / YapDatabaseTransaction . h > 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					NS_ASSUME_NONNULL_BEGIN  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					@ implementation  TSAttachmentStream @ implementation  TSAttachmentStream  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( instancetype ) initWithIdentifier : ( NSString  * ) identifier -  ( instancetype ) initWithIdentifier : ( NSString  * ) identifier  
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -73,15 +75,17 @@
 
			
		
	
		
		
			
				
					
					    return  count ; 
    return  count ; 
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( * ) filePath -  ( nullable  NSString * ) filePath  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					{ {  
			
		
	
		
		
			
				
					
					    return  [ MIMETypeUtil  filePathForAttachment : self . uniqueId 
    return  [ MIMETypeUtil  filePathForAttachment : self . uniqueId 
 
			
		
	
		
		
			
				
					
					                                    ofMIMEType : self . contentType 
                                    ofMIMEType : self . contentType 
 
			
		
	
		
		
			
				
					
					                                      inFolder : [ [ self  class ]  attachmentsFolder ] ] ; 
                                      inFolder : [ [ self  class ]  attachmentsFolder ] ] ; 
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( NSURL  * ) mediaURL  { -  ( nullable  NSURL  * ) mediaURL  
			
				
				
			
		
	
		
		
			
				
					
					    return  [ NSURL  fileURLWithPath : [ self  filePath ] ] ; 
{  
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					    NSString  * filePath  =  self . filePath ; 
 
			
		
	
		
		
			
				
					
					    return  filePath  ? [ NSURL  fileURLWithPath : filePath ]  :  nil ; 
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( BOOL ) isAnimated  { -  ( BOOL ) isAnimated  {  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -100,7 +104,8 @@
 
			
		
	
		
		
			
				
					
					    return  [ MIMETypeUtil  isAudio : self . contentType ] ; 
    return  [ MIMETypeUtil  isAudio : self . contentType ] ; 
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( UIImage  * ) image  { -  ( nullable  UIImage  * ) image  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					{  
			
		
	
		
		
			
				
					
					    if  ( [ self  isVideo ]  ||  [ self  isAudio ] )  { 
    if  ( [ self  isVideo ]  ||  [ self  isAudio ] )  { 
 
			
		
	
		
		
			
				
					
					        return  [ self  videoThumbnail ] ; 
        return  [ self  videoThumbnail ] ; 
 
			
		
	
		
		
			
				
					
					    }  else  { 
    }  else  { 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -109,7 +114,8 @@
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					-  ( UIImage  * ) videoThumbnail  { -  ( nullable  UIImage  * ) videoThumbnail  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					{  
			
		
	
		
		
			
				
					
					    AVURLAsset  * asset  =  [ [ AVURLAsset  alloc ]  initWithURL : [ NSURL  fileURLWithPath : self . filePath ]  options : nil ] ; 
    AVURLAsset  * asset  =  [ [ AVURLAsset  alloc ]  initWithURL : [ NSURL  fileURLWithPath : self . filePath ]  options : nil ] ; 
 
			
		
	
		
		
			
				
					
					    AVAssetImageGenerator  * generate          =  [ [ AVAssetImageGenerator  alloc ]  initWithAsset : asset ] ; 
    AVAssetImageGenerator  * generate          =  [ [ AVAssetImageGenerator  alloc ]  initWithAsset : asset ] ; 
 
			
		
	
		
		
			
				
					
					    generate . appliesPreferredTrackTransform  =  YES ; 
    generate . appliesPreferredTrackTransform  =  YES ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -129,3 +135,5 @@
 
			
		
	
		
		
			
				
					
					} }  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					@ end @ end  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					NS_ASSUME_NONNULL_END