aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/Models')
-rw-r--r--Hotline/Models/Hotline.swift13
1 files changed, 7 insertions, 6 deletions
diff --git a/Hotline/Models/Hotline.swift b/Hotline/Models/Hotline.swift
index 3cc8366..95a21c6 100644
--- a/Hotline/Models/Hotline.swift
+++ b/Hotline/Models/Hotline.swift
@@ -651,7 +651,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
}
else if status == .loggedIn {
if Prefs().playSounds && Prefs().playLoggedInSound {
- soundEffects.playSoundEffect(.loggedIn)
+ SoundEffectPlayer.shared.playSoundEffect(.loggedIn)
}
}
@@ -667,7 +667,6 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
}
func hotlineReceivedNewsPost(message: String) {
- soundEffects.playSoundEffect(.newNews)
let messageBoardRegex = /([\s\r\n]*[_\-]+[\s\r\n]+)/
let matches = message.matches(of: messageBoardRegex)
@@ -677,6 +676,8 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
} else {
self.messageBoard.insert(message, at: 0)
}
+
+ SoundEffectPlayer.shared.playSoundEffect(.newNews)
}
func hotlineReceivedServerMessage(message: String) {
@@ -686,7 +687,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
func hotlineReceivedChatMessage(message: String) {
if Prefs().playSounds && Prefs().playChatSound {
- soundEffects.playSoundEffect(.chatMessage)
+ SoundEffectPlayer.shared.playSoundEffect(.chatMessage)
}
self.chat.append(ChatMessage(text: message, type: .message, date: Date()))
}
@@ -725,7 +726,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
self.chat.append(ChatMessage(text: "\(user.name) left", type: .status, date: Date()))
if Prefs().playSounds && Prefs().playLeaveSound {
- soundEffects.playSoundEffect(.userLogout)
+ SoundEffectPlayer.shared.playSoundEffect(.userLogout)
}
}
}
@@ -810,7 +811,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
transfer.fileURL = at
transfer.downloadCallback?(transfer, at)
if Prefs().playSounds && Prefs().playFileTransferCompleteSound {
- soundEffects.playSoundEffect(.transferComplete)
+ SoundEffectPlayer.shared.playSoundEffect(.transferComplete)
}
}
@@ -833,7 +834,7 @@ class Hotline: Equatable, HotlineClientDelegate, HotlineFileClientDelegate {
else {
if !self.users.isEmpty {
if Prefs().playSounds && Prefs().playJoinSound {
- soundEffects.playSoundEffect(.userLogin)
+ SoundEffectPlayer.shared.playSoundEffect(.userLogin)
}
}