1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -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);
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
if (wins_is_current(window)) {
@ -291,14 +291,17 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
// not currently viewing chat window with sender
} else {
status_bar_new(num, WIN_CHAT, chatwin->barejid);
cons_show_incoming_message(display_name, num, chatwin->unread, window);
if (prefs_get_boolean(PREF_FLASH)) {
flash();
if (!message->is_mam) {
cons_show_incoming_message(display_name, num, chatwin->unread, window);
if (prefs_get_boolean(PREF_FLASH)) {
flash();
}
chatwin->unread++;
}
chatwin->unread++;
// TODO: so far we don't ask for MAM when incoming message occurs.
// Need to figure out:
// 1) only send IQ once
@ -326,7 +329,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
wins_add_urls_ac(window, message);
wins_add_quotes_ac(window, message->plain);
if (prefs_get_boolean(PREF_BEEP)) {
if (prefs_get_boolean(PREF_BEEP) && !message->is_mam) {
beep();
}