Only show reminder notifications when notifications are enabled

This commit is contained in:
James Booth
2015-11-25 22:08:33 +00:00
parent 20e63e364b
commit d3389db233
10 changed files with 73 additions and 18 deletions

View File

@@ -189,13 +189,16 @@ wins_set_current_by_num(int i)
ProfChatWin *chatwin = (ProfChatWin*) window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
chatwin->unread = 0;
chatwin->notify = FALSE;
} else if (window->type == WIN_MUC) {
ProfMucWin *mucwin = (ProfMucWin*) window;
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
mucwin->unread = 0;
mucwin->notify = FALSE;
} else if (window->type == WIN_PRIVATE) {
ProfPrivateWin *privatewin = (ProfPrivateWin*) window;
privatewin->unread = 0;
privatewin->notify = FALSE;
}
}
}
@@ -382,6 +385,23 @@ wins_new_private(const char *const fulljid)
return newwin;
}
gboolean
wins_get_notify(void)
{
GList *values = g_hash_table_get_values(windows);
GList *curr = values;
while (curr) {
ProfWin *window = curr->data;
if (win_notify(window)) {
g_list_free(values);
return TRUE;
}
curr = g_list_next(curr);
}
return FALSE;
}
int
wins_get_total_unread(void)
{