Skip to content

Commit 87186d8

Browse files
committed
Merge pull request nwjs#3182 from Arteris/libnotify_ver_check
Check for libnotify API version
2 parents 9a8b89b + 9e0824a commit 87186d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/nw_notification_manager_linux.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,18 @@ bool NotificationManagerLinux::AddDesktopNotification(const content::PlatformNot
8585
NotifyNotification * notif;
8686
NotificationMap::iterator i = getNotification(notification_id);
8787
if (i==mNotificationIDmap.end()) {
88+
#ifdef NOTIFY_CHECK_VERSION
89+
#if NOTIFY_CHECK_VERSION(0,7,0)
8890
notif = notify_notification_new (
8991
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL);
92+
#else
93+
notif = notify_notification_new (
94+
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL, NULL);
95+
#endif
96+
#else
97+
notif = notify_notification_new (
98+
base::UTF16ToUTF8(params.title).c_str(), base::UTF16ToUTF8(params.body).c_str(), NULL, NULL);
99+
#endif
90100
NotificationData data;
91101
data.mNotification = notif;
92102
data.mRenderProcessId = render_process_id;

0 commit comments

Comments
 (0)