Added ability to change volume of specific notifications from settings.

This commit is contained in:
23rd
2025-08-11 20:07:25 +03:00
parent 1c3cd8d44b
commit 1919546441
7 changed files with 54 additions and 8 deletions

View File

@@ -253,6 +253,7 @@ Descriptor ThreadDescriptor(not_null<Data::Thread*> thread) {
.currentSound = currentSound,
.updateSound = updateSound,
.updateMutePeriod = updateMutePeriod,
.volumeController = Data::ThreadRingtonesVolumeController(thread),
};
}
@@ -290,6 +291,7 @@ Descriptor DefaultDescriptor(
.currentSound = currentSound,
.updateSound = updateSound,
.updateMutePeriod = updateMutePeriod,
.volumeController = DefaultRingtonesVolumeController(session, type),
};
}
@@ -304,7 +306,8 @@ void FillMuteMenu(
RingtonesBox,
session,
*currentSound,
descriptor.updateSound));
descriptor.updateSound,
descriptor.volumeController));
}
};
menu->addAction(

View File

@@ -7,10 +7,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "data/notify/data_peer_notify_volume.h" // VolumeController
namespace Data {
class Thread;
struct NotifySound;
enum class DefaultNotify : uint8_t;
struct VolumeController;
} // namespace Data
namespace Main {
@@ -31,6 +34,7 @@ struct Descriptor {
Fn<std::optional<Data::NotifySound>()> currentSound;
Fn<void(Data::NotifySound)> updateSound;
Fn<void(TimeId)> updateMutePeriod;
Data::VolumeController volumeController;
};
[[nodiscard]] Descriptor ThreadDescriptor(not_null<Data::Thread*> thread);