diff options
Diffstat (limited to 'Hotline/Models')
| -rw-r--r-- | Hotline/Models/Hotline.swift | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift index 564845a..ccc23c1 100644 --- a/Hotline/Models/Hotline.swift +++ b/Hotline/Models/Hotline.swift @@ -136,6 +136,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { var transfers: [TransferInfo] = [] var downloads: [HotlineFileClient] = [] var unreadInstantMessages: [UInt16:UInt16] = [:] + var unreadPublicChat: Bool = false @ObservationIgnored var bannerClient: HotlineFileClient? #if os(macOS) @@ -226,6 +227,10 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { } } + func markPublicChatAsRead() { + self.unreadPublicChat = false + } + func hasUnreadInstantMessages(userID: UInt16) -> Bool { return self.unreadInstantMessages[userID] != nil } @@ -737,6 +742,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate { SoundEffectPlayer.shared.playSoundEffect(.chatMessage) } self.chat.append(ChatMessage(text: message, type: .message, date: Date())) + self.unreadPublicChat = true } func hotlineReceivedUserList(users: [HotlineUser]) { |