add thread flag for only notifying mentiongs
This commit is contained in:
parent
798b541241
commit
f0d2826403
|
@ -18,6 +18,7 @@ extern NSString *const TSGroupThread_NotificationKey_UniqueId;
|
||||||
@property (nonatomic, strong) TSGroupModel *groupModel;
|
@property (nonatomic, strong) TSGroupModel *groupModel;
|
||||||
@property (nonatomic, readonly) BOOL isOpenGroup;
|
@property (nonatomic, readonly) BOOL isOpenGroup;
|
||||||
@property (nonatomic, readonly) BOOL isClosedGroup;
|
@property (nonatomic, readonly) BOOL isClosedGroup;
|
||||||
|
@property (nonatomic) BOOL isOnlyNotifyMentions;
|
||||||
|
|
||||||
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
|
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
|
||||||
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel
|
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class ThreadViewModel: NSObject {
|
||||||
@objc public let contactSessionID: String?
|
@objc public let contactSessionID: String?
|
||||||
@objc public let name: String
|
@objc public let name: String
|
||||||
@objc public let isMuted: Bool
|
@objc public let isMuted: Bool
|
||||||
|
@objc public let isOnlyNotifyMentions: Bool
|
||||||
|
|
||||||
var isContactThread: Bool {
|
var isContactThread: Bool {
|
||||||
return !isGroupThread
|
return !isGroupThread
|
||||||
|
@ -39,6 +40,12 @@ public class ThreadViewModel: NSObject {
|
||||||
} else {
|
} else {
|
||||||
self.contactSessionID = nil
|
self.contactSessionID = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let groupThread = thread as? TSGroupThread {
|
||||||
|
self.isOnlyNotifyMentions = groupThread.isOnlyNotifyMentions
|
||||||
|
} else {
|
||||||
|
self.isOnlyNotifyMentions = false
|
||||||
|
}
|
||||||
|
|
||||||
self.unreadCount = thread.unreadMessageCount(transaction: transaction)
|
self.unreadCount = thread.unreadMessageCount(transaction: transaction)
|
||||||
self.hasUnreadMessages = unreadCount > 0
|
self.hasUnreadMessages = unreadCount > 0
|
||||||
|
|
Loading…
Reference in New Issue