1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Send NICK change before 001 request so that ircII also knows our real nick.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2211 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-07 15:58:58 +00:00 committed by cras
parent cb6e1286cd
commit fe8971ac8f
3 changed files with 15 additions and 16 deletions

View File

@ -200,13 +200,23 @@ static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
} }
} }
void proxy_dump_data(CLIENT_REC *client) void proxy_client_reset_nick(CLIENT_REC *client)
{ {
if (client->server != NULL) { if (client->server == NULL ||
strcmp(client->nick, client->server->nick) == 0)
return;
proxy_outdata(client, ":%s!proxy NICK :%s\n",
client->nick, client->server->nick);
g_free(client->nick); g_free(client->nick);
client->nick = g_strdup(client->server->nick); client->nick = g_strdup(client->server->nick);
} }
void proxy_dump_data(CLIENT_REC *client)
{
proxy_client_reset_nick(client);
/* welcome info */ /* welcome info */
proxy_outdata(client, ":%s 001 %s :Welcome to the Internet Relay Network\n", client->proxy_address, client->nick); proxy_outdata(client, ":%s 001 %s :Welcome to the Internet Relay Network\n", client->proxy_address, client->nick);
proxy_outdata(client, ":%s 002 %s :Your host is irssi-proxy, running version %s\n", client->proxy_address, client->nick, IRSSI_VERSION); proxy_outdata(client, ":%s 002 %s :Your host is irssi-proxy, running version %s\n", client->proxy_address, client->nick, IRSSI_VERSION);

View File

@ -358,18 +358,6 @@ static void sig_server_event(IRC_SERVER_REC *server, const char *line,
g_free(event); g_free(event);
} }
static void proxy_client_reset_nick(CLIENT_REC *client)
{
if (strcmp(client->nick, client->server->nick) == 0)
return;
proxy_outdata(client, ":%s!proxy NICK :%s\n",
client->nick, client->server->nick);
g_free(client->nick);
client->nick = g_strdup(client->server->nick);
}
static void event_connected(IRC_SERVER_REC *server) static void event_connected(IRC_SERVER_REC *server)
{ {
GSList *tmp; GSList *tmp;

View File

@ -39,6 +39,7 @@ void proxy_listen_deinit(void);
void proxy_settings_init(void); void proxy_settings_init(void);
void proxy_dump_data(CLIENT_REC *client); void proxy_dump_data(CLIENT_REC *client);
void proxy_client_reset_nick(CLIENT_REC *client);
void proxy_outdata(CLIENT_REC *client, const char *data, ...); void proxy_outdata(CLIENT_REC *client, const char *data, ...);
void proxy_outdata_all(IRC_SERVER_REC *server, const char *data, ...); void proxy_outdata_all(IRC_SERVER_REC *server, const char *data, ...);