|
|
@ -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
|
|
|
|