Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/screen.c @ 2190:ee3a40ffcd8b
New option: 'clear_unread_on_carbon'
If the new 'clear_unread_on_carbon' option is set to 1, clear the unread
message flag for a contact whenever an outgoing carbon copy of a message
sent to that contact is received from another client.
---
mcabber/mcabber/commands.c | 2 +-
mcabber/mcabber/hbuf.h | 1 +
mcabber/mcabber/hooks.c | 17 ++++++++++++-----
mcabber/mcabber/hooks.h | 2 +-
mcabber/mcabber/screen.c | 18 ++++++++++++++----
mcabber/mcabber/xmpp.c | 2 +-
mcabber/mcabberrc.example | 5 +++++
7 files changed, 35 insertions(+), 12 deletions(-)
author | Holger Weiß <holger@zedat.fu-berlin.de> |
---|---|
date | Thu, 23 Jul 2015 23:44:45 +0200 |
parents | bc10fc4eced7 |
children | 902f271743b0 |
comparison
equal
deleted
inserted
replaced
2189:3b91f6a100f5 | 2190:ee3a40ffcd8b |
---|---|
1466 char *text_locale; | 1466 char *text_locale; |
1467 int dont_show = FALSE; | 1467 int dont_show = FALSE; |
1468 int special; | 1468 int special; |
1469 guint num_history_blocks; | 1469 guint num_history_blocks; |
1470 bool setmsgflg = FALSE; | 1470 bool setmsgflg = FALSE; |
1471 bool clearmsgflg = FALSE; | |
1471 char *nicktmp, *nicklocaltmp; | 1472 char *nicktmp, *nicklocaltmp; |
1472 | 1473 |
1473 // Look for the window entry. | 1474 // Look for the window entry. |
1474 special = (winId == NULL); | 1475 special = (winId == NULL); |
1475 win_entry = scr_search_window(winId, special); | 1476 win_entry = scr_search_window(winId, special); |
1537 // Show and refresh the window | 1538 // Show and refresh the window |
1538 top_panel(win_entry->panel); | 1539 top_panel(win_entry->panel); |
1539 scr_update_window(win_entry); | 1540 scr_update_window(win_entry); |
1540 top_panel(inputPanel); | 1541 top_panel(inputPanel); |
1541 update_panels(); | 1542 update_panels(); |
1543 } else if (settings_opt_get_int("clear_unread_on_carbon") && | |
1544 prefix_flags & HBB_PREFIX_OUT && | |
1545 prefix_flags & HBB_PREFIX_CARBON) { | |
1546 clearmsgflg = TRUE; | |
1542 } else if (!(prefix_flags & HBB_PREFIX_NOFLAG)) { | 1547 } else if (!(prefix_flags & HBB_PREFIX_NOFLAG)) { |
1543 setmsgflg = TRUE; | 1548 setmsgflg = TRUE; |
1544 } | 1549 } |
1545 if (setmsgflg && !special) { | 1550 if (!special) { |
1546 roster_msg_setflag(winId, FALSE, TRUE); | 1551 if (clearmsgflg) { |
1547 update_roster = TRUE; | 1552 roster_msg_setflag(winId, FALSE, FALSE); |
1553 update_roster = TRUE; | |
1554 } else if (setmsgflg) { | |
1555 roster_msg_setflag(winId, FALSE, TRUE); | |
1556 update_roster = TRUE; | |
1557 } | |
1548 } | 1558 } |
1549 } | 1559 } |
1550 | 1560 |
1551 static char *attention_sign_guard(const gchar *key, const gchar *new_value) | 1561 static char *attention_sign_guard(const gchar *key, const gchar *new_value) |
1552 { | 1562 { |
2315 time_t timestamp, | 2325 time_t timestamp, |
2316 guint prefix, unsigned mucnicklen) | 2326 guint prefix, unsigned mucnicklen) |
2317 { | 2327 { |
2318 if (!(prefix & | 2328 if (!(prefix & |
2319 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & | 2329 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & |
2320 ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT)) | 2330 ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT & ~HBB_PREFIX_CARBON)) |
2321 prefix |= HBB_PREFIX_IN; | 2331 prefix |= HBB_PREFIX_IN; |
2322 | 2332 |
2323 scr_write_message(jidfrom, text, timestamp, prefix, mucnicklen, NULL); | 2333 scr_write_message(jidfrom, text, timestamp, prefix, mucnicklen, NULL); |
2324 } | 2334 } |
2325 | 2335 |