ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/src edit_contact_window.c,1.4,1.5 util.c,1.9


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src edit_contact_window.c,1.4,1.5 util.c,1.9,1.10 util.h,1.3,1.4
Date: Wed, 15 Jan 2003 09:04:50 -0500

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

Modified Files:
        edit_contact_window.c util.c util.h 
Log Message:
Rename contacts to friendlyname when 
their name equals their account name


Index: edit_contact_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/edit_contact_window.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- edit_contact_window.c       15 Jan 2003 07:54:59 -0000      1.4
+++ edit_contact_window.c       15 Jan 2003 14:04:47 -0000      1.5
@@ -47,14 +47,10 @@
 {
        gint service_id = 
get_service_id(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(service_list)->entry)));
         /* Rename log if logging is enabled */
-        rename_nick_log(my_contact->nick, gtk_entry_get_text(GTK_ENTRY(nick)));
-        strncpy(my_contact->nick, gtk_entry_get_text(GTK_ENTRY(nick)), 254);
-        my_contact->nick[254] = '\0';
+       rename_contact(my_contact, gtk_entry_get_text(GTK_ENTRY(nick)));
        my_contact->default_chatb = service_id;
        my_contact->default_filetransb = service_id;
        
-       if (my_contact->label)
-               gtk_label_set_text(GTK_LABEL(my_contact->label), 
my_contact->nick);
        
move_contact(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(group_list)->entry)),
                        my_contact);
        update_contact_list ();

Index: util.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- util.c      13 Jan 2003 07:23:27 -0000      1.9
+++ util.c      15 Jan 2003 14:04:47 -0000      1.10
@@ -1565,3 +1565,13 @@
        eb_debug(DBG_CORE, "Calling callback\n");
        mid->callback(ecd);
 }
+
+void rename_contact( struct contact * c, char *newname) {
+        rename_nick_log(c->nick, newname);
+        strncpy(c->nick, newname, 254);
+        c->nick[254] = '\0';
+       if (c->label)
+               gtk_label_set_text(GTK_LABEL(c->label), newname);
+       update_contact_list ();
+       write_contact_list();
+}

Index: util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- util.h      13 Jan 2003 07:23:27 -0000      1.3
+++ util.h      15 Jan 2003 14:04:47 -0000      1.4
@@ -100,6 +100,7 @@
 void strip_html(gchar * text);
 void remove_account( eb_account * a );
 void remove_contact( struct contact * c );
+void rename_contact( struct contact * c, char *newname);
 void remove_group( grouplist * g );
 void add_group( gchar * name );
 struct contact * add_new_contact( gchar * group, gchar * con, gint type );





reply via email to

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