AyuGramDesktop/Telegram/SourceFiles/platform/linux/notifications_manager_linux_dummy.cpp
2023-03-15 15:00:29 +04:00

56 lines
1.1 KiB
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "platform/linux/notifications_manager_linux.h"
#include "base/platform/base_platform_info.h"
namespace Platform {
namespace Notifications {
bool SkipToastForCustom() {
return false;
}
void MaybePlaySoundForCustom(Fn<void()> playSound) {
playSound();
}
void MaybeFlashBounceForCustom(Fn<void()> flashBounce) {
flashBounce();
}
bool WaitForInputForCustom() {
return true;
}
bool Supported() {
return false;
}
bool Enforced() {
// Wayland doesn't support positioning
// and custom notifications don't work here
return IsWayland();
}
bool ByDefault() {
return false;
}
void Create(Window::Notifications::System *system) {
if (Enforced()) {
using DummyManager = Window::Notifications::DummyManager;
system->setManager(std::make_unique<DummyManager>(system));
} else {
system->setManager(nullptr);
}
}
} // namespace Notifications
} // namespace Platform