From 4e7f478d1e512cf20509b79ba07c7d91655e0c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 13 Apr 2016 04:02:23 +0200 Subject: [PATCH] LibnotifyLoader: add notify_get_server_info support --- brightray/browser/linux/libnotify_loader.cc | 10 ++++++++++ brightray/browser/linux/libnotify_loader.h | 1 + 2 files changed, 11 insertions(+) diff --git a/brightray/browser/linux/libnotify_loader.cc b/brightray/browser/linux/libnotify_loader.cc index ede4eeec67..61d7422689 100644 --- a/brightray/browser/linux/libnotify_loader.cc +++ b/brightray/browser/linux/libnotify_loader.cc @@ -38,6 +38,15 @@ bool LibNotifyLoader::Load(const std::string& library_name) { return false; } + notify_get_server_info = + reinterpret_castnotify_get_server_info)>( + dlsym(library_, "notify_get_server_info")); + notify_get_server_info = &::notify_get_server_info; + if (!notify_get_server_info) { + CleanUp(true); + return false; + } + notify_notification_new = reinterpret_castnotify_notification_new)>( dlsym(library_, "notify_notification_new")); @@ -104,6 +113,7 @@ void LibNotifyLoader::CleanUp(bool unload) { loaded_ = false; notify_is_initted = NULL; notify_init = NULL; + notify_get_server_info = NULL; notify_notification_new = NULL; notify_notification_add_action = NULL; notify_notification_set_image_from_pixbuf = NULL; diff --git a/brightray/browser/linux/libnotify_loader.h b/brightray/browser/linux/libnotify_loader.h index 6cf2853af2..32b01cf433 100644 --- a/brightray/browser/linux/libnotify_loader.h +++ b/brightray/browser/linux/libnotify_loader.h @@ -20,6 +20,7 @@ class LibNotifyLoader { decltype(&::notify_is_initted) notify_is_initted; decltype(&::notify_init) notify_init; + decltype(&::notify_get_server_info) notify_get_server_info; decltype(&::notify_notification_new) notify_notification_new; decltype(&::notify_notification_add_action) notify_notification_add_action; decltype(&::notify_notification_set_image_from_pixbuf) notify_notification_set_image_from_pixbuf;