mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			47 lines
		
	
	
		
			839 B
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			47 lines
		
	
	
		
			839 B
		
	
	
	
		
			Matlab
		
	
| 
											8 years ago
										 | // | ||
|  | //  Copyright (c) 2017 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
| 
											9 years ago
										 | 
 | ||
|  | #import "OWSGroupAvatarBuilder.h" | ||
|  | #import "TSGroupThread.h" | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
|  | @interface OWSGroupAvatarBuilder () | ||
|  | 
 | ||
|  | @property (nonatomic, readonly) TSGroupThread *thread; | ||
|  | 
 | ||
|  | @end | ||
|  | 
 | ||
|  | @implementation OWSGroupAvatarBuilder | ||
|  | 
 | ||
|  | - (instancetype)initWithThread:(TSGroupThread *)thread | ||
|  | { | ||
|  |     self = [super init]; | ||
|  |     if (!self) { | ||
|  |         return self; | ||
|  |     } | ||
|  | 
 | ||
|  |     _thread = thread; | ||
|  | 
 | ||
|  |     return self; | ||
|  | } | ||
|  | 
 | ||
|  | - (nullable UIImage *)buildSavedImage | ||
|  | { | ||
|  |     return self.thread.groupModel.groupImage; | ||
|  | } | ||
|  | 
 | ||
|  | - (UIImage *)buildDefaultImage | ||
|  | { | ||
| 
											8 years ago
										 |     static UIImage *defaultGroupImage; | ||
|  |     static dispatch_once_t onceToken; | ||
|  |     dispatch_once(&onceToken, ^{ | ||
|  |         defaultGroupImage = [UIImage imageNamed:@"empty-group-avatar"]; | ||
|  |     }); | ||
|  |     return defaultGroupImage; | ||
| 
											9 years ago
										 | } | ||
|  | 
 | ||
|  | @end | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_END |