Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
signalapp
GitHub Repository: signalapp/Signal-iOS
Path: blob/main/SignalServiceKit/Groups/TSGroupModel.h
1 views
1
//
2
// Copyright 2017 Signal Messenger, LLC
3
// SPDX-License-Identifier: AGPL-3.0-only
4
//
5
6
@import Foundation;
7
8
NS_ASSUME_NONNULL_BEGIN
9
10
@class GroupAccess;
11
@class GroupMembership;
12
@class SignalServiceAddress;
13
14
extern const NSUInteger kGroupIdLengthV1;
15
extern const NSUInteger kGroupIdLengthV2;
16
extern const uint64_t kMaxEncryptedAvatarSize;
17
extern const uint64_t kMaxAvatarSize;
18
19
typedef NS_CLOSED_ENUM(uint32_t, GroupsVersion) {
20
GroupsVersionV1 = 0,
21
GroupsVersionV2
22
};
23
24
// NOTE: This class is tightly coupled to TSGroupModelBuilder.
25
// If you modify this class - especially if you
26
// add any new properties - make sure to update
27
// TSGroupModelBuilder.
28
@interface TSGroupModel : NSObject <NSSecureCoding, NSCopying>
29
30
// groupMembers includes administrators and normal members.
31
@property (nonatomic, readonly) NSArray<SignalServiceAddress *> *groupMembers;
32
@property (nonatomic, readonly, nullable) NSString *groupName;
33
@property (nonatomic, readonly) NSData *groupId;
34
@property (nonatomic, readonly, nullable) SignalServiceAddress *addedByAddress;
35
36
#if TARGET_OS_IOS
37
// This data should always be in PNG format.
38
@property (nonatomic, nullable) NSData *legacyAvatarData;
39
@property (nonatomic, nullable) NSString *avatarHash;
40
41
@property (nonatomic, readonly) GroupsVersion groupsVersion;
42
@property (nonatomic, readonly) GroupMembership *groupMembership;
43
44
+ (instancetype)new NS_UNAVAILABLE;
45
- (instancetype)init NS_UNAVAILABLE;
46
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
47
48
- (instancetype)initWithGroupId:(NSData *)groupId
49
name:(nullable NSString *)name
50
avatarData:(nullable NSData *)avatarData
51
members:(NSArray<SignalServiceAddress *> *)members
52
addedByAddress:(nullable SignalServiceAddress *)addedByAddress NS_DESIGNATED_INITIALIZER;
53
#endif
54
55
@property (nonatomic, readonly) NSString *groupNameOrDefault;
56
57
@end
58
59
NS_ASSUME_NONNULL_END
60
61