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.9,1.10 editcontacts.c,1.9,


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src chat_room.c,1.9,1.10 editcontacts.c,1.9,1.10
Date: Thu, 09 Jan 2003 03:42:42 -0500

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

Modified Files:
        chat_room.c editcontacts.c 
Log Message:
try to stabilize accounts edition, be sure there's only once the same
person in chatroom


Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- chat_room.c 9 Jan 2003 01:14:42 -0000       1.9
+++ chat_room.c 9 Jan 2003 08:42:40 -0000       1.10
@@ -373,14 +373,21 @@
 
 void eb_chat_room_buddy_arrive( eb_chat_room * room, gchar * alias, gchar * 
handle )
 {
-       eb_chat_room_buddy * ecrb = g_new0(eb_chat_room_buddy, 1 );
+       eb_chat_room_buddy * ecrb = NULL;
         gchar *buf;
+       GList *t;
+       ecrb = g_new0(eb_chat_room_buddy, 1 );
+       strcpy( ecrb->alias, alias);
+       strcpy( ecrb->handle, handle );
+
+       for (t = room->fellows; t && t->data; t = t->next) {
+               if(!strcmp(handle, ((eb_chat_room_buddy *)t->data)->handle))
+                       return;
+       }
+
         buf = g_strdup_printf(_("<i>%s (%s) has joined the chat</i>"), alias, 
handle);
         eb_chat_room_show_3rdperson(room, buf);
        g_free(buf);
-
-       strcpy( ecrb->alias, alias);
-       strcpy( ecrb->handle, handle );
 
        room->fellows = g_list_append(room->fellows, ecrb);
 

Index: editcontacts.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/editcontacts.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- editcontacts.c      9 Jan 2003 08:29:47 -0000       1.9
+++ editcontacts.c      9 Jan 2003 08:42:40 -0000       1.10
@@ -227,7 +227,7 @@
        int id;
        gboolean had_accounts=(accounts != NULL);
        GList *pairs=NULL;
-       GList *existing_accounts = NULL, *new_accounts = NULL, *acc_walk = NULL;
+       GList *existing_accounts = NULL, *new_accounts = NULL, *acc_walk = 
NULL, *to_remove = NULL;
        eb_local_account *ela=NULL;
 
        if (gtk_entry_get_text(GTK_ENTRY(username)) != NULL
@@ -297,10 +297,13 @@
                                if(removed && removed->connected 
                                && RUN_SERVICE(removed)->logout != NULL)
                                        RUN_SERVICE(removed)->logout(removed);
-                               accounts = 
g_list_remove(accounts,acc_walk->data);
+                               to_remove = g_list_append(to_remove, 
acc_walk->data);
                        }
                        acc_walk = acc_walk->next;
                }
+               for (acc_walk = to_remove; acc_walk && acc_walk->data; 
acc_walk=acc_walk->next)
+                       accounts = g_list_remove(accounts,acc_walk->data);
+               g_list_free(to_remove);
        }
        
        acc_walk = new_accounts;





reply via email to

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