Bug 737646 - no biff notification if notification-daemon not running. r=karlt

This commit is contained in:
Wolfgang Rosenauer 2012-03-26 10:51:40 +02:00
Родитель 0e82d01876
Коммит 9305f76d5c
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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