ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src chat_room.c,1.50,1.51 chat_room.h,1.14,1.


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src chat_room.c,1.50,1.51 chat_room.h,1.14,1.15
Date: Wed, 05 Mar 2003 08:45:59 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv13414/src

Modified Files:
        chat_room.c chat_room.h 
Log Message:
prepare for chatroom special colors


Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- chat_room.c 5 Mar 2003 11:26:54 -0000       1.50
+++ chat_room.c 5 Mar 2003 13:45:57 -0000       1.51
@@ -53,6 +53,19 @@
 static char *last_clicked_fellow = NULL;
 static guint32 last_time_clicked = 0;
 
+static char *cr_colors[]={
+       "#ff0055",
+       "#ff009d",
+       "#6e00ff",
+       "#0072ff",
+       "#00ffaa",
+       "#21ff00",
+       "#9dff00",
+       "#ffff00",
+       "#ff9400"
+};
+static int nb_cr_colors = 9;
+
 static void handle_fellow_click (char *name, eb_local_account *ela)
 {
        eb_account *ea = NULL;
@@ -620,7 +633,9 @@
        ecrb = g_new0(eb_chat_room_buddy, 1 );
        strcpy( ecrb->alias, alias);
        strcpy( ecrb->handle, handle );
-
+       room->total_arrivals++;
+       ecrb->color = room->total_arrivals % nb_cr_colors;
+       
        for (t = room->fellows; t && t->data; t = t->next) {
                if(!strcasecmp(handle, ((eb_chat_room_buddy *)t->data)->handle))
                        return;
@@ -718,22 +733,26 @@
        {
                time_t t;
                struct tm * cur_time;
+               char *color;
                
+               color = "#0000ff";
+       
                time(&t);
                cur_time = localtime(&t);
                if (iGetLocalPref("do_convo_timestamp")) {
-                       g_snprintf(buff, 2048, "<B><FONT 
COLOR=\"#0000FF\">%d:%.2d:%.2d</FONT> <FONT COLOR=\"#0000FF\">%s: </FONT></B>",
+                       g_snprintf(buff, 2048, "<B><FONT 
COLOR=\"%s\">%d:%.2d:%.2d</FONT> <FONT COLOR=\"%s\">%s: </FONT></B>",
+                        color, 
                         cur_time->tm_hour, cur_time->tm_min,
-                        cur_time->tm_sec, chat_room->local_user->alias);
+                        cur_time->tm_sec, color, chat_room->local_user->alias);
                } else {
-                       g_snprintf(buff, 2048, "<FONT COLOR=\"#0000FF\"><B>%s: 
</B></FONT>", chat_room->local_user->alias);
+                       g_snprintf(buff, 2048, "<FONT COLOR=\"%s\"><B>%s: 
</B></FONT>", chat_room->local_user->alias);
                }
        }
        else
        {
                LList *walk;
                eb_account *acc = NULL;
-               gchar * color;
+               gchar * color = NULL;
                time_t t;
                struct tm * cur_time;
                
@@ -753,8 +772,8 @@
                }
                for (walk = chat_room->typing_fellows; walk && walk->data; walk 
= walk->next) {
                        acc = walk->data;
-                       if (!strcmp(acc->handle, user)
-                       ||  !strcmp(acc->account_contact->nick, user))
+                       if (!strcasecmp(acc->handle, user)
+                       ||  !strcasecmp(acc->account_contact->nick, user))
                                break;
                        else
                                acc = NULL;

Index: chat_room.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- chat_room.h 4 Mar 2003 15:48:11 -0000       1.14
+++ chat_room.h 5 Mar 2003 13:45:57 -0000       1.15
@@ -36,6 +36,7 @@
 {
        char alias[255];
        char handle[255];
+       int color;
 } eb_chat_room_buddy;
 
 typedef struct _eb_chat_room
@@ -72,7 +73,8 @@
        LList * fellows;   /* who is in the chat room */
        GtkWidget *fellows_widget;  /* CList of online folks */
        LList * typing_fellows;
-
+       int total_arrivals;
+       
        void *protocol_local_chat_room_data; /* For protocol-specific storage */
 
        /*





reply via email to

[Prev in Thread] Current Thread [Next in Thread]