From 8dd886979ec61e5adb73d8c662de07070be75d41 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sat, 11 May 2024 19:55:17 -0700 Subject: Add "Show Join/Leave in Chat" option --- Hotline/Models/Preferences.swift | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Hotline/Models/Preferences.swift') diff --git a/Hotline/Models/Preferences.swift b/Hotline/Models/Preferences.swift index 3925bc7..207ce91 100644 --- a/Hotline/Models/Preferences.swift +++ b/Hotline/Models/Preferences.swift @@ -17,6 +17,7 @@ enum PrefsKeys: String { case playErrorSound = "play error sound" case playChatInvitationSound = "play chat invitation sound" case showBannerToolbar = "show banner toolbar" + case showJoinLeaveMessages = "show join leave messages" } @Observable @@ -39,6 +40,7 @@ class Prefs { PrefsKeys.playErrorSound.rawValue: true, PrefsKeys.playChatInvitationSound.rawValue: true, PrefsKeys.showBannerToolbar.rawValue: true, + PrefsKeys.showJoinLeaveMessages.rawValue: true, ]) self.username = UserDefaults.standard.string(forKey: PrefsKeys.username.rawValue)! @@ -57,6 +59,7 @@ class Prefs { self.playErrorSound = UserDefaults.standard.bool(forKey: PrefsKeys.playErrorSound.rawValue) self.playChatInvitationSound = UserDefaults.standard.bool(forKey: PrefsKeys.playChatInvitationSound.rawValue) self.showBannerToolbar = UserDefaults.standard.bool(forKey: PrefsKeys.showBannerToolbar.rawValue) + self.showJoinLeaveMessages = UserDefaults.standard.bool(forKey: PrefsKeys.showJoinLeaveMessages.rawValue) } public static let shared = Prefs() @@ -124,4 +127,8 @@ class Prefs { var showBannerToolbar: Bool { didSet { UserDefaults.standard.set(self.showBannerToolbar, forKey: PrefsKeys.showBannerToolbar.rawValue) } } + + var showJoinLeaveMessages: Bool { + didSet { UserDefaults.standard.set(self.showJoinLeaveMessages, forKey: PrefsKeys.showJoinLeaveMessages.rawValue) } + } } -- cgit