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.
		
		
		
		
		
			
		
			
				
	
	
		
			63 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Objective-C
		
	
			
		
		
	
	
			63 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Objective-C
		
	
//
 | 
						|
//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | 
						|
//
 | 
						|
 | 
						|
#import <SessionMessagingKit/TSGroupModel.h>
 | 
						|
#import <SessionMessagingKit/TSThread.h>
 | 
						|
 | 
						|
NS_ASSUME_NONNULL_BEGIN
 | 
						|
 | 
						|
@class TSAttachmentStream;
 | 
						|
@class YapDatabaseReadWriteTransaction;
 | 
						|
 | 
						|
extern NSString *const TSGroupThreadAvatarChangedNotification;
 | 
						|
extern NSString *const TSGroupThread_NotificationKey_UniqueId;
 | 
						|
 | 
						|
@interface TSGroupThread : TSThread
 | 
						|
 | 
						|
@property (nonatomic, strong) TSGroupModel *groupModel;
 | 
						|
@property (nonatomic, readonly) BOOL isOpenGroup;
 | 
						|
@property (nonatomic, readonly) BOOL isClosedGroup;
 | 
						|
 | 
						|
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
 | 
						|
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel
 | 
						|
                                    transaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
+ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId
 | 
						|
                                   groupType:(GroupType) groupType;
 | 
						|
+ (instancetype)getOrCreateThreadWithGroupId:(NSData *)groupId
 | 
						|
                                   groupType:(GroupType) groupType
 | 
						|
                                 transaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
+ (nullable instancetype)threadWithGroupId:(NSData *)groupId transaction:(YapDatabaseReadTransaction *)transaction;
 | 
						|
 | 
						|
+ (NSString *)threadIdFromGroupId:(NSData *)groupId;
 | 
						|
 | 
						|
+ (NSString *)defaultGroupName;
 | 
						|
 | 
						|
- (BOOL)isCurrentUserMemberInGroup;
 | 
						|
- (BOOL)isUserMemberInGroup:(NSString *)publicKey;
 | 
						|
- (BOOL)isUserAdminInGroup:(NSString *)publicKey;
 | 
						|
 | 
						|
// all group threads containing recipient as a member
 | 
						|
+ (NSArray<TSGroupThread *> *)groupThreadsWithRecipientId:(NSString *)recipientId
 | 
						|
                                              transaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
- (void)setGroupModel:(TSGroupModel *)newGroupModel withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
- (void)leaveGroupWithSneakyTransaction;
 | 
						|
- (void)leaveGroupWithTransaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
- (void)softDeleteGroupThreadWithTransaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
#pragma mark - Avatar
 | 
						|
 | 
						|
- (void)updateAvatarWithAttachmentStream:(TSAttachmentStream *)attachmentStream;
 | 
						|
- (void)updateAvatarWithAttachmentStream:(TSAttachmentStream *)attachmentStream
 | 
						|
                             transaction:(YapDatabaseReadWriteTransaction *)transaction;
 | 
						|
 | 
						|
- (void)fireAvatarChangedNotification;
 | 
						|
 | 
						|
@end
 | 
						|
 | 
						|
NS_ASSUME_NONNULL_END
 |