diff options
author | Timo Sirainen <cras@irssi.org> | 2001-09-06 13:12:52 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-09-06 13:12:52 +0000 |
commit | 1cb3f94eebc63492c9f1e042c944dbc0f14dce19 (patch) | |
tree | 246fc29d513a54d9995c48595489595fe163e9de | |
parent | cac1cbf2cfa4d2abad92feb35233ac2ac06e92f6 (diff) | |
download | irssi-1cb3f94eebc63492c9f1e042c944dbc0f14dce19.zip |
Use only the first word from username when sending it to server.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1776 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/irc/core/irc-servers.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 11cef94d..6ff6ff7d 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -109,7 +109,7 @@ static void sig_server_looking(IRC_SERVER_REC *server) static void server_init(IRC_SERVER_REC *server) { IRC_SERVER_CONNECT_REC *conn; - char hostname[100], *address, *ptr; + char hostname[100], *address, *ptr, *username; g_return_if_fail(server != NULL); @@ -144,8 +144,14 @@ static void server_init(IRC_SERVER_REC *server) the last : char */ address = ptr+1; } - irc_send_cmdv(server, "USER %s %s %s :%s", conn->username, hostname, + + username = g_strdup(conn->username); + ptr = strchr(username, ' '); + if (ptr != NULL) *ptr = '\0'; + + irc_send_cmdv(server, "USER %s %s %s :%s", username, hostname, address, conn->realname); + g_free(username); server->cmdcount = 0; } |