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.51,1.52


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src chat_room.c,1.51,1.52
Date: Wed, 05 Mar 2003 09:38:46 -0500

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

Modified Files:
        chat_room.c 
Log Message:
use alias + handle to find back accounts


Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- chat_room.c 5 Mar 2003 13:45:57 -0000       1.51
+++ chat_room.c 5 Mar 2003 14:38:44 -0000       1.52
@@ -66,14 +66,30 @@
 };
 static int nb_cr_colors = 9;
 
-static void handle_fellow_click (char *name, eb_local_account *ela)
+static void handle_fellow_click (char *name, eb_chat_room *cr)
 {
        eb_account *ea = NULL;
+       LList *node = NULL;
+       char *handle = NULL;
        
-       if (find_account_by_handle(name, ela->service_id)) {
-               ea = find_account_by_handle(name, ela->service_id);
+       for( node = cr->fellows; node; node = node->next )
+       {
+               eb_chat_room_buddy * ecrb = node->data;
+               if (!strcasecmp(ecrb->alias, name)) {
+                       handle = ecrb->handle;
+                       break;
+               }
+       }
+       
+       if (find_account_by_handle(name, cr->local_user->service_id)) {
+               ea = find_account_by_handle(name, cr->local_user->service_id);
+       } else if (handle && find_account_by_handle(handle, 
cr->local_user->service_id)) {
+               ea = find_account_by_handle(handle, cr->local_user->service_id);
+       } else if (find_contact_by_nick(name)) {
+               eb_chat_window_display_contact(find_contact_by_nick(name));
+               return;
        } else {
-               ea = RUN_SERVICE(ela)->new_account(name);
+               ea = RUN_SERVICE(cr->local_user)->new_account(name);
                add_unknown_account_window_new(ea);
        }
        eb_chat_window_display_account(ea);
@@ -90,7 +106,7 @@
                        if (evt->time - last_time_clicked < 2000
                        && !strcmp(last_clicked_fellow, name)) {
                                /* double-click ! */
-                               handle_fellow_click(name, ecr->local_user);
+                               handle_fellow_click(name, ecr);
                                free(last_clicked_fellow);
                                last_clicked_fellow = NULL;
                                return;





reply via email to

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