1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Don't notify on MAM messages

This commit is contained in:
MarcoPolo-PasTonMolo 2022-08-20 23:03:46 +03:00
parent a704838152
commit d692aec32e

View File

@ -280,7 +280,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
free(mybarejid); free(mybarejid);
gboolean is_current = wins_is_current(window); gboolean is_current = wins_is_current(window);
gboolean notify = prefs_do_chat_notify(is_current); gboolean notify = prefs_do_chat_notify(is_current) && !message->is_mam;
// currently viewing chat window with sender // currently viewing chat window with sender
if (wins_is_current(window)) { if (wins_is_current(window)) {
@ -291,6 +291,8 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
// not currently viewing chat window with sender // not currently viewing chat window with sender
} else { } else {
status_bar_new(num, WIN_CHAT, chatwin->barejid); status_bar_new(num, WIN_CHAT, chatwin->barejid);
if (!message->is_mam) {
cons_show_incoming_message(display_name, num, chatwin->unread, window); cons_show_incoming_message(display_name, num, chatwin->unread, window);
if (prefs_get_boolean(PREF_FLASH)) { if (prefs_get_boolean(PREF_FLASH)) {
@ -298,6 +300,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
} }
chatwin->unread++; chatwin->unread++;
}
// TODO: so far we don't ask for MAM when incoming message occurs. // TODO: so far we don't ask for MAM when incoming message occurs.
// Need to figure out: // Need to figure out:
@ -326,7 +329,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
wins_add_urls_ac(window, message); wins_add_urls_ac(window, message);
wins_add_quotes_ac(window, message->plain); wins_add_quotes_ac(window, message->plain);
if (prefs_get_boolean(PREF_BEEP)) { if (prefs_get_boolean(PREF_BEEP) && !message->is_mam) {
beep(); beep();
} }