diff mcabber/src/hooks.c @ 1290:e42f48103609

Drawing the MUC nicks by a different color (color is hardcoded to red, needs to be changed to something useable)
author Michal 'vorner' Vaner <vorner@ucw.cz>
date Sun, 26 Aug 2007 18:24:14 +0200
parents 7c8672bbede5
children 0dda8238af21
line wrap: on
line diff
--- a/mcabber/src/hooks.c	Mon Aug 27 13:02:16 2007 +0200
+++ b/mcabber/src/hooks.c	Sun Aug 26 18:24:14 2007 +0200
@@ -49,6 +49,7 @@
   guint rtype = ROSTER_TYPE_USER;
   char *wmsg = NULL, *bmsg = NULL, *mmsg = NULL;
   GSList *roster_usr;
+  unsigned mucnicklen = 0;
 
   if (encrypted)
     message_flags |= HBB_PREFIX_PGPCRYPT;
@@ -63,6 +64,7 @@
       wmsg = bmsg = g_strdup_printf("~ %s", msg);
     } else {
       wmsg = bmsg = g_strdup_printf("<%s> %s", resname, msg);
+      mucnicklen = strlen(resname) + 2;
       if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME)))
         wmsg = mmsg = g_strdup_printf("*%s %s", resname, msg+4);
     }
@@ -157,7 +159,7 @@
   // Note: the hlog_write should not be called first, because in some
   // cases scr_WriteIncomingMessage() will load the history and we'd
   // have the message twice...
-  scr_WriteIncomingMessage(bjid, wmsg, timestamp, message_flags);
+  scr_WriteIncomingMessage(bjid, wmsg, timestamp, message_flags, mucnicklen);
 
   // We don't log the modified message, but the original one
   if (wmsg == mmsg)
@@ -306,7 +308,7 @@
                            imstatus2char[oldstat], imstatus2char[status],
                            ((status_msg) ? status_msg : ""));
       scr_WriteIncomingMessage(bjid, bn, timestamp,
-                               HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG);
+                               HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0);
       g_free(bn);
     }
   }