2021-01-05 13:02:54 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
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"
|
|
|
|
|
2021-01-10 14:32:03 +00:00
|
|
|
#include "base/platform/base_platform_info.h"
|
|
|
|
|
2021-01-05 13:02:54 +00:00
|
|
|
namespace Platform {
|
|
|
|
namespace Notifications {
|
|
|
|
|
2021-04-29 07:21:38 +00:00
|
|
|
bool SkipAudioForCustom() {
|
2021-01-05 13:02:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-04-29 07:21:38 +00:00
|
|
|
bool SkipToastForCustom() {
|
2021-01-05 13:02:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-04-29 07:21:38 +00:00
|
|
|
bool SkipFlashBounceForCustom() {
|
2021-01-05 13:02:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Supported() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-01-13 09:56:49 +00:00
|
|
|
bool Enforced() {
|
|
|
|
// Wayland doesn't support positioning
|
|
|
|
// and custom notifications don't work here
|
|
|
|
return IsWayland();
|
|
|
|
}
|
|
|
|
|
2021-01-24 23:16:32 +00:00
|
|
|
bool ByDefault() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-01-21 10:18:40 +00:00
|
|
|
void Create(Window::Notifications::System *system) {
|
2021-01-13 09:56:49 +00:00
|
|
|
if (Enforced()) {
|
2021-01-21 10:18:40 +00:00
|
|
|
using DummyManager = Window::Notifications::DummyManager;
|
|
|
|
system->setManager(std::make_unique<DummyManager>(system));
|
|
|
|
} else {
|
|
|
|
system->setManager(nullptr);
|
2021-01-05 13:02:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Notifications
|
|
|
|
} // namespace Platform
|