From: Sean E. <sea...@us...> - 2002-05-04 08:21:33
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv31863/src Modified Files: conversation.c core.h gaimrc.c multi.c ui.h Log Message: Self-aliasing from the account editor. You can edit how your screenname shows up in sent messages without having yourself on your list. This is strictly client-side only--has no affect on what your buddies see. I'm thinking it might not be a bad idea to add the alias somewhere in the various select-account menus and lists. This could potentially fix the can't-tell-what-IRC-account-I'm-joining-channels-in problem, but I'm not sure the best way to do it right now--I'll do it tommorow. IM me if you have good ideas. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.350 retrieving revision 1.351 diff -u -d -r1.350 -r1.351 --- conversation.c 25 Apr 2002 05:57:45 -0000 1.350 +++ conversation.c 4 May 2002 08:21:30 -0000 1.351 @@ -1764,6 +1764,8 @@ b = find_buddy(c->gc, c->gc->username); if (b && strcmp(b->name, b->show)) who = b->show; + else if (c->gc->user->alias[0]) + who = c->gc->user->alias; else if (c->gc->displayname[0]) who = c->gc->displayname; else Index: core.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/core.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- core.h 12 Apr 2002 02:15:24 -0000 1.17 +++ core.h 4 May 2002 08:21:31 -0000 1.18 @@ -38,8 +38,12 @@ /* Really user states are controlled by the PRPLs now. We just use this for event_away */ #define UC_UNAVAILABLE 1 +/* This is far too long to be practical, but MSN users are probably used to long aliases */ +#define SELF_ALIAS_LEN 400 + struct aim_user { char username[64]; + char alias[SELF_ALIAS_LEN]; char password[32]; char user_info[2048]; int options; Index: gaimrc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaimrc.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- gaimrc.c 28 Mar 2002 18:05:48 -0000 1.94 +++ gaimrc.c 4 May 2002 08:21:31 -0000 1.95 @@ -534,6 +534,19 @@ g_snprintf(u->iconfile, sizeof(u->iconfile), "%s", p->value[0]); + if (!fgets(buf, sizeof(buf), f)) + return u; + + if (!strcmp(buf, "\t}")) + return u; + + p = parse_line(buf); + + if (strcmp(p->option, "alias")) + return u; + + g_snprintf(u->alias, sizeof(u->alias), "%s", p->value[0]); + return u; } @@ -570,8 +583,8 @@ fprintf(f, " { %s }", u->proto_opt[i]); fprintf(f, "\n"); fprintf(f, "\t\ticonfile { %s }\n", u->iconfile); + fprintf(f, "\t\talias { %s }\n", u->alias); } - static void gaimrc_read_users(FILE *f) { Index: multi.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/multi.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- multi.c 29 Mar 2002 13:28:55 -0000 1.115 +++ multi.c 4 May 2002 08:21:31 -0000 1.116 @@ -275,6 +275,8 @@ a->protocol = u->protocol; txt = gtk_entry_get_text(GTK_ENTRY(u->name)); g_snprintf(a->username, sizeof(a->username), "%s", txt); + txt = gtk_entry_get_text(GTK_ENTRY(u->alias)); + g_snprintf(a->alias, sizeof(a->alias), "%s", txt); txt = gtk_entry_get_text(GTK_ENTRY(u->pass)); if (a->options & OPT_USR_REM_PASS) g_snprintf(a->password, sizeof(a->password), "%s", txt); @@ -553,6 +555,15 @@ hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + + label = gtk_label_new(_("Alias:")); + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); + + u->alias = gtk_entry_new(); + gtk_box_pack_start(GTK_BOX(hbox), u->alias, TRUE, TRUE, 0); + + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_widget_show(hbox); label = gtk_label_new(_("Protocol:")); @@ -567,6 +578,7 @@ if (u->user) { gtk_entry_set_text(GTK_ENTRY(u->name), u->user->username); + gtk_entry_set_text(GTK_ENTRY(u->alias), u->user->alias); gtk_entry_set_text(GTK_ENTRY(u->pass), u->user->password); } Index: ui.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/ui.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ui.h 27 Apr 2002 19:41:07 -0000 1.36 +++ ui.h 4 May 2002 08:21:31 -0000 1.37 @@ -242,6 +242,7 @@ GtkWidget *mod; GtkWidget *main; GtkWidget *name; + GtkWidget *alias; GtkWidget *pwdbox; GtkWidget *pass; GtkWidget *rempass; |