mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Merge branch 'master' into plugins
Conflicts: src/ui/core.c src/ui/notifier.c
This commit is contained in:
commit
c49cbbc938
@ -95,7 +95,6 @@ _ui_init(void)
|
||||
create_input_window();
|
||||
wins_init();
|
||||
cons_about();
|
||||
notifier_init();
|
||||
#ifdef PROF_HAVE_LIBXSS
|
||||
display = XOpenDisplay(0);
|
||||
#endif
|
||||
|
@ -37,14 +37,6 @@
|
||||
#include "muc.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
static void
|
||||
_notifier_init(void)
|
||||
{
|
||||
#ifdef PROF_HAVE_LIBNOTIFY
|
||||
notify_init("Profanity");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
_notifier_uninit(void)
|
||||
{
|
||||
@ -168,6 +160,15 @@ _notify(const char * const message, int timeout,
|
||||
const char * const category)
|
||||
{
|
||||
#ifdef PROF_HAVE_LIBNOTIFY
|
||||
log_debug("Attempting notification: %s", message);
|
||||
if (notify_is_initted()) {
|
||||
log_debug("Reinitialising libnotify");
|
||||
notify_uninit();
|
||||
notify_init("Profanity");
|
||||
} else {
|
||||
log_debug("Initialising libnotify");
|
||||
notify_init("Profanity");
|
||||
}
|
||||
if (notify_is_initted()) {
|
||||
NotifyNotification *notification;
|
||||
notification = notify_notification_new("Profanity", message, NULL);
|
||||
@ -182,9 +183,11 @@ _notify(const char * const message, int timeout,
|
||||
log_error("Error sending desktop notification:");
|
||||
log_error(" -> Message : %s", message);
|
||||
log_error(" -> Error : %s", error->message);
|
||||
}
|
||||
} else {
|
||||
log_debug("Notification sent.");
|
||||
}
|
||||
} else {
|
||||
log_error("Libnotify initialisation error.");
|
||||
log_error("Libnotify not initialised.");
|
||||
}
|
||||
#endif
|
||||
#ifdef PROF_PLATFORM_CYGWIN
|
||||
@ -241,7 +244,6 @@ _notify(const char * const message, int timeout,
|
||||
void
|
||||
notifier_init_module(void)
|
||||
{
|
||||
notifier_init = _notifier_init;
|
||||
notifier_uninit = _notifier_uninit;
|
||||
notify_typing = _notify_typing;
|
||||
notify_invite = _notify_invite;
|
||||
|
@ -263,7 +263,6 @@ void (*ui_status_bar_active)(const int win);
|
||||
void (*ui_status_bar_new)(const int win);
|
||||
|
||||
// desktop notifier actions
|
||||
void (*notifier_init)(void);
|
||||
void (*notifier_uninit)(void);
|
||||
|
||||
void (*notify_typing)(const char * const handle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user