diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-04-28 14:11:02 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-04-28 14:11:02 +0000 |
commit | aa172e0afbd634b236854b3590556b099e08cb29 (patch) | |
tree | f3e3c2e365da95716b924c2243cdc6375c0074d9 /src/irc | |
parent | 83c178c16924b1ee868fe827ee7a9061a4ddd9aa (diff) | |
download | irssi-aa172e0afbd634b236854b3590556b099e08cb29.zip |
Do not send hostname to server, rather use username as the second
argument to USER, patch by Alex Tarkovsky (bug #488).
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4468 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-servers.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index ff35b249..79c274ff 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -102,7 +102,7 @@ static void send_message(SERVER_REC *server, const char *target, static void server_init(IRC_SERVER_REC *server) { IRC_SERVER_CONNECT_REC *conn; - char hostname[100], *address, *ptr, *username, *cmd; + char *address, *ptr, *username, *cmd; GTimeVal now; g_return_if_fail(server != NULL); @@ -135,9 +135,6 @@ static void server_init(IRC_SERVER_REC *server) g_free(cmd); /* send user/realname */ - if (gethostname(hostname, sizeof(hostname)) != 0 || *hostname == '\0') - strcpy(hostname, "xx"); - address = server->connrec->address; ptr = strrchr(address, ':'); if (ptr != NULL) { @@ -148,29 +145,11 @@ static void server_init(IRC_SERVER_REC *server) address = "x"; } - /* Replace ':' with '_' in our own hostname (the same IPv6 problem) */ - /* Replace '\n' and '\r' with '\0' in our own hostname to fix multiple PTR addreses */ - for (ptr = hostname; *ptr != '\0'; ptr++) { - if (*ptr == ':') *ptr = '_'; - if (*ptr == '\n') *ptr = '\0'; - if (*ptr == '\r') *ptr = '\0'; - } - - /* don't allow hostname to begin with number or '+', '-'. those - can be interpreted as ircnet ircd's mode parameter. - - username/hostname parameters should probably be configurable since - they're only needed with some old servers which uses them to count - unique users. */ - if ((hostname[0] >= '0' && hostname[0] <= '9') || - hostname[0] == '+' || hostname[0] == '-') - hostname[0] = '_'; - username = g_strdup(conn->username); ptr = strchr(username, ' '); if (ptr != NULL) *ptr = '\0'; - cmd = g_strdup_printf("USER %s %s %s :%s", username, hostname, address, conn->realname); + cmd = g_strdup_printf("USER %s %s %s :%s", username, username, address, conn->realname); irc_send_cmd_now(server, cmd); g_free(cmd); g_free(username); |