зеркало из https://github.com/mozilla/gecko-dev.git
Bug 737646 - no biff notification if notification-daemon not running. r=karlt
This commit is contained in:
Родитель
0e82d01876
Коммит
9305f76d5c
|
@ -53,6 +53,7 @@
|
|||
#endif
|
||||
|
||||
static bool gHasActions = false;
|
||||
static bool gHasCaps = false;
|
||||
|
||||
static void notify_action_cb(NotifyNotification *notification,
|
||||
gchar *action, gpointer user_data)
|
||||
|
@ -344,6 +345,7 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl,
|
|||
|
||||
GList *server_caps = notify_get_server_caps();
|
||||
if (server_caps) {
|
||||
gHasCaps = true;
|
||||
for (GList* cap = server_caps; cap != NULL; cap = cap->next) {
|
||||
if (!strcmp((char*) cap->data, "actions")) {
|
||||
gHasActions = true;
|
||||
|
@ -355,6 +357,12 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl,
|
|||
}
|
||||
}
|
||||
|
||||
if (!gHasCaps) {
|
||||
// if notify_get_server_caps() failed above we need to assume
|
||||
// there is no notification-server to display anything
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!gHasActions && aAlertTextClickable)
|
||||
return NS_ERROR_FAILURE; // No good, fallback to XUL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче