|  |  | @ -119,6 +119,27 @@ NS_ASSUME_NONNULL_BEGIN | 
			
		
	
		
		
			
				
					
					|  |  |  |     [self addArrangedSubview:imageView]; |  |  |  |     [self addArrangedSubview:imageView]; | 
			
		
	
		
		
			
				
					
					|  |  |  |     [imageView setContentHuggingHigh]; |  |  |  |     [imageView setContentHuggingHigh]; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     NSString *filename = self.attachmentStream.sourceFilename; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (!filename) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         filename = [[self.attachmentStream filePath] lastPathComponent]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     NSString *fileExtension = filename.pathExtension; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (fileExtension.length < 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         fileExtension = [MIMETypeUtil fileExtensionForMIMEType:self.attachmentStream.contentType]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     UILabel *fileTypeLabel = [UILabel new]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.text = fileExtension.uppercaseString; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.textColor = UIColor.ows_light90Color; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.adjustsFontSizeToFitWidth = YES; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     fileTypeLabel.textAlignment = NSTextAlignmentCenter; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     // Center on icon. | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     [imageView addSubview:fileTypeLabel]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     [fileTypeLabel autoCenterInSuperview]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     [fileTypeLabel autoSetDimension:ALDimensionWidth toSize:self.iconWidth - 20.f]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     UIStackView *labelsView = [UIStackView new]; |  |  |  |     UIStackView *labelsView = [UIStackView new]; | 
			
		
	
		
		
			
				
					
					|  |  |  |     labelsView.axis = UILayoutConstraintAxisVertical; |  |  |  |     labelsView.axis = UILayoutConstraintAxisVertical; | 
			
		
	
		
		
			
				
					
					|  |  |  |     labelsView.spacing = [OWSGenericAttachmentView labelVSpacing]; |  |  |  |     labelsView.spacing = [OWSGenericAttachmentView labelVSpacing]; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |