changeset 3205:332df87cf3d6

[gaim-migrate @ 3222] 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. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 04 May 2002 08:21:31 +0000
parents 20769d05df16
children 2558c2f7e539
files ChangeLog src/conversation.c src/core.h src/gaimrc.c src/multi.c src/ui.h
diffstat 6 files changed, 35 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat May 04 04:20:42 2002 +0000
+++ b/ChangeLog	Sat May 04 08:21:31 2002 +0000
@@ -10,6 +10,8 @@
 	  Brian Bernas)
 	* Hide and unhide functions for the filectl plugin.
 	  (Thanks, Ari Pollak)
+	* Added helpful stuff to the Help menu.
+	* Self-aliasing from the account editor.
 
 version 0.57 (04/25/2002):
 	* New authorization method for Yahoo!
--- a/src/conversation.c	Sat May 04 04:20:42 2002 +0000
+++ b/src/conversation.c	Sat May 04 08:21:31 2002 +0000
@@ -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
--- a/src/core.h	Sat May 04 04:20:42 2002 +0000
+++ b/src/core.h	Sat May 04 08:21:31 2002 +0000
@@ -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;
--- a/src/gaimrc.c	Sat May 04 04:20:42 2002 +0000
+++ b/src/gaimrc.c	Sat May 04 08:21:31 2002 +0000
@@ -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,9 +583,9 @@
 		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)
 {
 	char buf[2048];
--- a/src/multi.c	Sat May 04 04:20:42 2002 +0000
+++ b/src/multi.c	Sat May 04 08:21:31 2002 +0000
@@ -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);
 	}
 
--- a/src/ui.h	Sat May 04 04:20:42 2002 +0000
+++ b/src/ui.h	Sat May 04 08:21:31 2002 +0000
@@ -242,6 +242,7 @@
 	GtkWidget *mod;
 	GtkWidget *main;
 	GtkWidget *name;
+	GtkWidget *alias;
 	GtkWidget *pwdbox;
 	GtkWidget *pass;
 	GtkWidget *rempass;