Use ircnet name as the proxy's "real address".

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@825 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-11-09 21:40:22 +00:00 committed by cras
commit 4211d1e80b
3 changed files with 36 additions and 26 deletions

View file

@ -141,10 +141,11 @@ void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...)
static void create_names_start(GString *str, IRC_CHANNEL_REC *channel,
CLIENT_REC *client)
{
g_string_sprintf(str, ":proxy 353 %s %c %s :", client->nick,
channel_mode_is_set(channel, 'p') ? '*' :
channel_mode_is_set(channel, 's') ? '@' : '=',
channel->name);
g_string_sprintf(str, ":%s 353 %s %c %s :",
client->proxy_address, client->nick,
channel_mode_is_set(channel, 'p') ? '*' :
channel_mode_is_set(channel, 's') ? '@' : '=',
channel->name);
}
static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
@ -189,11 +190,12 @@ static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
proxy_outdata(client, str->str);
g_string_free(str, TRUE);
proxy_outdata(client, ":proxy 366 %s %s :End of /NAMES list.\n",
client->nick, channel->name);
proxy_outdata(client, ":%s 366 %s %s :End of /NAMES list.\n",
client->proxy_address, client->nick, channel->name);
if (channel->topic != NULL) {
proxy_outdata(client, ":proxy 332 %s %s :%s\n",
client->nick, channel->name, channel->topic);
proxy_outdata(client, ":%s 332 %s %s :%s\n",
client->proxy_address, client->nick,
channel->name, channel->topic);
}
}
@ -211,23 +213,25 @@ void plugin_proxy_dump_data(CLIENT_REC *client)
}
/* welcome info */
proxy_outdata(client, ":proxy 001 %s :Welcome to the Internet Relay Network\n", client->nick);
proxy_outdata(client, ":proxy 002 %s :Your host is irssi-proxy, running version %s\n", client->nick, VERSION);
proxy_outdata(client, ":proxy 003 %s :This server was created ...\n", 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, VERSION);
proxy_outdata(client, ":%s 003 %s :This server was created ...\n", client->nick);
if (client->server == NULL || !client->server->emode_known)
proxy_outdata(client, ":proxy 004 %s proxy %s oirw abiklmnopqstv\n", client->nick, VERSION);
proxy_outdata(client, ":%s 004 %s proxy %s oirw abiklmnopqstv\n", client->proxy_address, client->nick, VERSION);
else
proxy_outdata(client, ":proxy 004 %s proxy %s oirw abeIiklmnopqstv\n", client->nick, VERSION);
proxy_outdata(client, ":proxy 251 %s :There are 0 users and 0 invisible on 1 servers\n", client->nick);
proxy_outdata(client, ":proxy 255 %s :I have 0 clients, 0 services and 0 servers\n", client->nick);
proxy_outdata(client, ":proxy 422 %s :MOTD File is missing\n", client->nick);
proxy_outdata(client, ":%s 004 %s proxy %s oirw abeIiklmnopqstv\n", client->proxy_address, client->nick, VERSION);
proxy_outdata(client, ":%s 251 %s :There are 0 users and 0 invisible on 1 servers\n", client->proxy_address, client->nick);
proxy_outdata(client, ":%s 255 %s :I have 0 clients, 0 services and 0 servers\n", client->proxy_address, client->nick);
proxy_outdata(client, ":%s 422 %s :MOTD File is missing\n", client->proxy_address, client->nick);
/* user mode / away status */
if (client->server != NULL) {
proxy_outserver(client, "MODE %s :+%s", client->server->nick,
client->server->usermode);
if (client->server->usermode_away)
proxy_outdata(client, ":proxy 306 %s :You have been marked as being away\n", client->nick);
if (client->server->usermode_away) {
proxy_outdata(client, ":%s 306 %s :You have been marked as being away\n",
client->proxy_address, client->nick);
}
/* Send channel joins */
g_slist_foreach(client->server->channels, (GFunc) dump_join, client);