# HG changeset patch # User Mikael Berthe # Date 1269181120 -3600 # Node ID 48e47198a9dbcd74faa7906ae7a64c3ef0eebf05 # Parent 35a1250c111af676599c67271c17a83941fff522 Use urgent flag The urgent sign is set (in MUC rooms only so far) diff -r 35a1250c111a -r 48e47198a9db mcabber/mcabber/hooks.c --- a/mcabber/mcabber/hooks.c Sun Mar 21 15:14:24 2010 +0100 +++ b/mcabber/mcabber/hooks.c Sun Mar 21 15:18:40 2010 +0100 @@ -196,7 +196,7 @@ GSList *roster_usr; unsigned mucnicklen = 0; const char *ename = NULL; - gboolean attention = FALSE; + gboolean attention = FALSE, mucprivmsg = FALSE; if (encrypted == ENCRYPTED_PGP) message_flags |= HBB_PREFIX_PGPCRYPT; @@ -283,6 +283,7 @@ g_free(mmsg); wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); } + mucprivmsg = TRUE; } message_flags |= HBB_PREFIX_HLIGHT; } else { @@ -332,6 +333,20 @@ // have the message twice... scr_write_incoming_message(bjid, wmsg, timestamp, message_flags, mucnicklen); + // Set urgent (a.k.a. "attention") flag + { + guint uip; + if (is_groupchat) { + if (mucprivmsg) uip = ROSTER_UI_PRIO_MUC_PRIV_MESSAGE; + else if (attention) uip = ROSTER_UI_PRIO_MUC_HL_MESSAGE; + else uip = ROSTER_UI_PRIO_MUC_MESSAGE; + } else { + if (attention) uip = ROSTER_UI_PRIO_ATTENTION_MESSAGE; + else uip = ROSTER_UI_PRIO_PRIVATE_MESSAGE; + } + scr_setattentionflag_if_needed(bjid, FALSE, uip, prio_max); + } + // We don't log the modified message, but the original one if (wmsg == mmsg) wmsg = bmsg;