changeset 2305:0371b905baef

[gaim-migrate @ 2315] hi committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 18 Sep 2001 18:17:21 +0000
parents 15fb364935ec
children 7973a8348d8b
files src/protocols/irc/irc.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c
diffstat 3 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/irc.c	Tue Sep 18 01:46:56 2001 +0000
+++ b/src/protocols/irc/irc.c	Tue Sep 18 18:17:21 2001 +0000
@@ -1135,6 +1135,7 @@
 			return -EINVAL;
 		g_snprintf(buf, sizeof(buf), "PRIVMSG %s :%s\r\n", who, word_eol[2]);
 		irc_write(id->fd, buf, strlen(buf));
+		return 1;
 	} else if (!g_strcasecmp(pdibuf, "MSG")) {
 		if (!*word[2])
 			return -EINVAL;
@@ -1189,9 +1190,20 @@
 		write_to_conv(c, "<B>Currently supported commands:<BR>"
 				 "JOIN PART TOPIC<BR>"
 				 "OP DEOP VOICE DEVOICE KICK<BR>"
-				 "NICK ME MSG QUOTE SAY</B><BR>",
+				 "NICK ME MSG QUOTE SAY</B>",
 				 WFLAG_SYSTEM, NULL, time(NULL));
+	} else {
+		struct conversation *c = NULL;
+		if (is_channel(gc, who)) {
+			c = irc_find_chat(gc, who);
+		} else {
+			c = find_conversation(who);
+		}
+		if (!c)
+			return -EINVAL;
+		write_to_conv(c, "<B>Unsupported command</B>", WFLAG_SYSTEM, NULL, time(NULL));
 	}
+
 	return 0;
 }
 
--- a/src/protocols/oscar/oscar.c	Tue Sep 18 01:46:56 2001 +0000
+++ b/src/protocols/oscar/oscar.c	Tue Sep 18 18:17:21 2001 +0000
@@ -1123,6 +1123,7 @@
 	time_t time_idle;
 	int type = 0;
 	struct gaim_connection *gc = sess->aux_data;
+	char *tmp;
 
 	va_list ap;
 	va_start(ap, fr);
@@ -1146,6 +1147,11 @@
 	} else
 		time_idle = 0;
 
+	tmp = g_strdup(normalize(gc->username));
+	if (!strcmp(tmp, normalize(info->sn)))
+		g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", info->sn);
+	g_free(tmp);
+
 	serv_got_update(gc, info->sn, 1, info->warnlevel/10, info->onlinesince,
 			time_idle, type, info->capabilities);
 
--- a/src/protocols/toc/toc.c	Tue Sep 18 01:46:56 2001 +0000
+++ b/src/protocols/toc/toc.c	Tue Sep 18 18:17:21 2001 +0000
@@ -444,7 +444,7 @@
 
 		serv_got_im(gc, c, message, a, time((time_t)NULL));
 	} else if (!strcasecmp(c, "UPDATE_BUDDY")) {
-		char *l, *uc;
+		char *l, *uc, *tmp;
 		int logged, evil, idle, type = 0;
 		time_t signon, time_idle;
 
@@ -481,6 +481,11 @@
 		} else
 			time_idle = 0;
 
+		tmp = g_strdup(normalize(gc->username));
+		if (!strcmp(tmp, normalize(c)))
+			g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", c);
+		g_free(tmp);
+
 		serv_got_update(gc, c, logged, evil, signon, time_idle, type, 0);
 	} else if (!strcasecmp(c, "ERROR")) {
 		c = strtok(NULL, ":");