mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-20 01:18:29 +00:00
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#include "tool/Utils.hpp"
|
|
|
|
// #include "NotificationActivator.hpp"
|
|
#include "WindowsNotificationBackend.hpp"
|
|
#include "core/App.hpp"
|
|
#include "core/call/CallGui.hpp"
|
|
#include "core/chat/ChatGui.hpp"
|
|
#include "core/event-filter/LockEventFilter.hpp"
|
|
#include "tool/Utils.hpp"
|
|
#include <QDebug>
|
|
|
|
NotificationBackend::NotificationBackend(QObject *parent) : AbstractNotificationBackend(parent) {
|
|
// connect(App::getInstance(), &App::sessionLockedChanged, this, [this] {
|
|
// if (!App::getInstance()->getSessionLocked()) {
|
|
// qDebug() << "Session unlocked, flush pending notifications";
|
|
// flushPendingNotifications();
|
|
// }
|
|
// });
|
|
}
|
|
|
|
void NotificationBackend::flushPendingNotifications() {
|
|
for (const auto ¬if : mPendingNotifications) {
|
|
sendNotification(notif.type, notif.data);
|
|
}
|
|
mPendingNotifications.clear();
|
|
}
|
|
|
|
void NotificationBackend::sendMessageNotification(QVariantMap data) {
|
|
}
|
|
|
|
void NotificationBackend::sendCallNotification(QVariantMap data) {
|
|
}
|
|
|
|
void NotificationBackend::sendNotification(NotificationType type, QVariantMap data) {
|
|
// if (App::getInstance()->getSessionLocked()) {
|
|
// mPendingNotifications.append({type, data});
|
|
// return;
|
|
// }
|
|
switch (type) {
|
|
case NotificationType::ReceivedCall:
|
|
sendCallNotification(data);
|
|
break;
|
|
case NotificationType::ReceivedMessage:
|
|
sendMessageNotification(data);
|
|
break;
|
|
}
|
|
}
|