2020-04-14 15:53:53 +00:00
|
|
|
#include "notifications.h"
|
|
|
|
|
|
|
|
#include <base/detect.h>
|
|
|
|
|
2021-02-12 12:40:29 +00:00
|
|
|
#if defined(CONF_PLATFORM_MACOS)
|
|
|
|
// Code is in src/macos/notification.mm.
|
2020-04-14 15:53:53 +00:00
|
|
|
#elif defined(CONF_FAMILY_UNIX)
|
|
|
|
#include <libnotify/notify.h>
|
|
|
|
void NotificationsInit()
|
|
|
|
{
|
|
|
|
notify_init("DDNet Client");
|
|
|
|
}
|
|
|
|
void NotificationsUninit()
|
|
|
|
{
|
|
|
|
notify_uninit();
|
|
|
|
}
|
|
|
|
void NotificationsNotify(const char *pTitle, const char *pMessage)
|
|
|
|
{
|
2020-09-30 20:40:19 +00:00
|
|
|
NotifyNotification *pNotif = notify_notification_new(pTitle, pMessage, "ddnet");
|
2020-04-14 15:53:53 +00:00
|
|
|
notify_notification_show(pNotif, NULL);
|
|
|
|
g_object_unref(G_OBJECT(pNotif));
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
void NotificationsInit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void NotificationsUninit()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
void NotificationsNotify(const char *pTitle, const char *pMessage)
|
|
|
|
{
|
|
|
|
(void)pTitle;
|
|
|
|
(void)pMessage;
|
|
|
|
}
|
|
|
|
#endif
|