mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 11:38:19 +00:00
3b1c074842
- Haiku is Unix-like, but it still doesn't use libnotify. - Haiku comes with its own sets of definitions for certain long variables. There's still a problem revolving around the variables, but I removed a duplicate, conflicting definition on the Haiku platform. - Changed some definition-related logic in detect.h, because the gcc compiler in Haiku (version 8.3.0) complained about duplicate definitions. I chose to use 'unknown' rather than an empty string on one occasion. - Changed size of m_aLastSoundPlayed[CHAT_NUM] in `src/game/client/components/chat.cpp` due to an undocumented/undiscovered bug in Haiku.
36 lines
771 B
C++
36 lines
771 B
C++
#include "notifications.h"
|
|
|
|
#include <base/detect.h>
|
|
|
|
#if defined(CONF_PLATFORM_MACOS)
|
|
// Code is in src/macos/notification.mm.
|
|
#elif defined(CONF_FAMILY_UNIX) && !defined(CONF_PLATFORM_ANDROID) && !defined(CONF_PLATFORM_HAIKU)
|
|
#include <libnotify/notify.h>
|
|
void NotificationsInit()
|
|
{
|
|
notify_init("DDNet Client");
|
|
}
|
|
void NotificationsUninit()
|
|
{
|
|
notify_uninit();
|
|
}
|
|
void NotificationsNotify(const char *pTitle, const char *pMessage)
|
|
{
|
|
NotifyNotification *pNotif = notify_notification_new(pTitle, pMessage, "ddnet");
|
|
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
|