Fix notification sounds on macOS.

This commit is contained in:
John Preston 2025-01-24 20:37:12 +04:00
parent 1b16a84810
commit 22ec7a6d75

View file

@ -697,6 +697,7 @@ void System::showNext() {
break;
}
const auto notifyItem = notify->item;
const auto notifySilent = computeSkipState(*notify).silent;
const auto messageType = (notify->type
== Data::ItemNotificationType::Message);
const auto isForwarded = messageType
@ -773,7 +774,7 @@ void System::showNext() {
if (!_lastHistoryItemId && groupedItem) {
_lastHistorySessionId = groupedItem->history()->session().uniqueId();
_lastHistoryItemId = groupedItem->fullId();
_lastSoundId = MaybeSoundFor(
_lastSoundId = notifySilent ? std::nullopt : MaybeSoundFor(
notifyThread,
groupedItem->specialNotificationPeer());
}
@ -794,7 +795,7 @@ void System::showNext() {
_lastForwardedCount += forwardedCount;
_lastHistorySessionId = groupedItem->history()->session().uniqueId();
_lastHistoryItemId = groupedItem->fullId();
_lastSoundId = MaybeSoundFor(
_lastSoundId = notifySilent ? std::nullopt : MaybeSoundFor(
notifyThread,
groupedItem->specialNotificationPeer());
_waitForAllGroupedTimer.callOnce(kWaitingForAllGroupedDelay);
@ -817,7 +818,9 @@ void System::showNext() {
.forwardedCount = forwardedCount,
.reactionFrom = notify->reactionSender,
.reactionId = reaction,
.soundId = MaybeSoundFor(notifyThread, soundFrom),
.soundId = (notifySilent
? std::nullopt
: MaybeSoundFor(notifyThread, soundFrom)),
});
}
}