diff options
author | James Booth <boothj5@gmail.com> | 2015-11-25 22:08:33 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-11-25 22:33:26 +0000 |
commit | d3389db2336544b6f611ef03d7eb390ab4f7d295 (patch) | |
tree | 23c13c4c31663a912f756ee39c87cef817b809a4 /src/ui/window.c | |
parent | 20e63e364b45894d481a35e019602183255e3496 (diff) | |
download | profani-tty-d3389db2336544b6f611ef03d7eb390ab4f7d295.tar.gz |
Only show reminder notifications when notifications are enabled
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 9317f3b8..d6500a67 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -141,6 +141,7 @@ win_create_chat(const char *const barejid) new_win->pgp_send = FALSE; new_win->history_shown = FALSE; new_win->unread = 0; + new_win->notify = FALSE; new_win->state = chat_state_new(); new_win->memcheck = PROFCHATWIN_MEMCHECK; @@ -180,6 +181,7 @@ win_create_muc(const char *const roomjid) new_win->roomjid = strdup(roomjid); new_win->unread = 0; + new_win->notify = FALSE; if (prefs_get_boolean(PREF_OCCUPANTS_JID)) { new_win->showjid = TRUE; } else { @@ -215,6 +217,7 @@ win_create_private(const char *const fulljid) new_win->fulljid = strdup(fulljid); new_win->unread = 0; + new_win->notify = FALSE; new_win->memcheck = PROFPRIVATEWIN_MEMCHECK; @@ -1245,6 +1248,26 @@ win_has_active_subwin(ProfWin *window) } } +gboolean +win_notify(ProfWin *window) +{ + if (window->type == WIN_CHAT) { + ProfChatWin *chatwin = (ProfChatWin*) window; + assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); + return chatwin->notify; + } else if (window->type == WIN_MUC) { + ProfMucWin *mucwin = (ProfMucWin*) window; + assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); + return mucwin->notify; + } else if (window->type == WIN_PRIVATE) { + ProfPrivateWin *privatewin = (ProfPrivateWin*) window; + assert(privatewin->memcheck == PROFPRIVATEWIN_MEMCHECK); + return privatewin->notify; + } else { + return FALSE; + } +} + int win_unread(ProfWin *window) { |