Added ability to change volume of specific notifications from settings.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user