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
		
	
	
	
		
			Objective-C
		
	
			
		
		
	
	
			47 lines
		
	
	
		
			839 B
		
	
	
	
		
			Objective-C
		
	
//
 | 
						|
//  Copyright (c) 2017 Open Whisper Systems. All rights reserved.
 | 
						|
//
 | 
						|
 | 
						|
#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
 | 
						|
{
 | 
						|
    static UIImage *defaultGroupImage;
 | 
						|
    static dispatch_once_t onceToken;
 | 
						|
    dispatch_once(&onceToken, ^{
 | 
						|
        defaultGroupImage = [UIImage imageNamed:@"empty-group-avatar"];
 | 
						|
    });
 | 
						|
    return defaultGroupImage;
 | 
						|
}
 | 
						|
 | 
						|
@end
 | 
						|
 | 
						|
NS_ASSUME_NONNULL_END
 |