diff mcabber/src/hooks.c @ 728:421b337dc6d2

Chat window: Highlight the flag in our messages
author Mikael Berthe <mikael@lilotux.net>
date Mon, 06 Mar 2006 10:25:24 +0100
parents ee03b56b93ee
children 39f67cade02c
line wrap: on
line diff
--- a/mcabber/src/hooks.c	Sun Mar 05 22:29:14 2006 +0100
+++ b/mcabber/src/hooks.c	Mon Mar 06 10:25:24 2006 +0100
@@ -84,13 +84,23 @@
 
   is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM);
 
-  if (!is_groupchat && is_room) {
-    // This is a private message from a room participant
-    if (!resname)
-      resname = "";
-    wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg);
-    if (!strncmp(msg, "/me ", 4))
-      wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4);
+  if (is_room) {
+    if (!is_groupchat) {
+      // This is a private message from a room participant
+      if (!resname)
+        resname = "";
+      wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg);
+      if (!strncmp(msg, "/me ", 4))
+        wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4);
+      message_flags |= HBB_PREFIX_HLIGHT;
+    } else {
+      // This is a regular chatroom message.
+      // Let's see if we are the message sender, in which case we'll
+      // highlight it.
+      const char *nick = buddy_getnickname(roster_usr->data);
+      if (resname && nick && !strcmp(resname, nick))
+        message_flags |= HBB_PREFIX_HLIGHT;
+    }
   }
 
   if (type && !strcmp(type, "error")) {