mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Merge pull request #269 from blha303/master
Replace \n with \r\n in irssiproxy source, fixes bug
This commit is contained in:
commit
14c7c0484c
@ -83,7 +83,7 @@ void proxy_outserver(CLIENT_REC *client, const char *data, ...)
|
||||
va_start(args, data);
|
||||
|
||||
str = g_strdup_vprintf(data, args);
|
||||
proxy_outdata(client, ":%s!%s@proxy %s\n", client->nick,
|
||||
proxy_outdata(client, ":%s!%s@proxy %s\r\n", client->nick,
|
||||
settings_get_str("user_name"), str);
|
||||
g_free(str);
|
||||
|
||||
@ -106,7 +106,7 @@ void proxy_outserver_all(IRC_SERVER_REC *server, const char *data, ...)
|
||||
CLIENT_REC *rec = tmp->data;
|
||||
|
||||
if (rec->connected && rec->server == server) {
|
||||
proxy_outdata(rec, ":%s!%s@proxy %s\n", rec->nick,
|
||||
proxy_outdata(rec, ":%s!%s@proxy %s\r\n", rec->nick,
|
||||
settings_get_str("user_name"), str);
|
||||
}
|
||||
}
|
||||
@ -132,7 +132,7 @@ void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...)
|
||||
|
||||
if (rec->connected && rec != client &&
|
||||
rec->server == client->server) {
|
||||
proxy_outdata(rec, ":%s!%s@proxy %s\n", rec->nick,
|
||||
proxy_outdata(rec, ":%s!%s@proxy %s\r\n", rec->nick,
|
||||
settings_get_str("user_name"), str);
|
||||
}
|
||||
}
|
||||
@ -169,7 +169,7 @@ static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
|
||||
NICK_REC *nick = tmp->data;
|
||||
|
||||
if (str->len >= 500) {
|
||||
g_string_append_c(str, '\n');
|
||||
g_string_append_c(str, '\r\n');
|
||||
proxy_outdata(client, "%s", str->str);
|
||||
create_names_start(str, channel, client);
|
||||
first = TRUE;
|
||||
@ -186,21 +186,21 @@ static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
|
||||
}
|
||||
g_slist_free(nicks);
|
||||
|
||||
g_string_append_c(str, '\n');
|
||||
g_string_append_c(str, '\r\n');
|
||||
proxy_outdata(client, "%s", str->str);
|
||||
g_string_free(str, TRUE);
|
||||
|
||||
proxy_outdata(client, ":%s 366 %s %s :End of /NAMES list.\n",
|
||||
proxy_outdata(client, ":%s 366 %s %s :End of /NAMES list.\r\n",
|
||||
client->proxy_address, client->nick, channel->name);
|
||||
if (channel->topic != NULL) {
|
||||
/* this is needed because the topic may be encoded into other charsets internaly */
|
||||
recoded = recode_out(SERVER(client->server), channel->topic, channel->name);
|
||||
proxy_outdata(client, ":%s 332 %s %s :%s\n",
|
||||
proxy_outdata(client, ":%s 332 %s %s :%s\r\n",
|
||||
client->proxy_address, client->nick,
|
||||
channel->name, recoded);
|
||||
g_free(recoded);
|
||||
if (channel->topic_time > 0)
|
||||
proxy_outdata(client, ":%s 333 %s %s %s %d\n",
|
||||
proxy_outdata(client, ":%s 333 %s %s %s %d\r\n",
|
||||
client->proxy_address, client->nick,
|
||||
channel->name, channel->topic_by, channel->topic_time);
|
||||
}
|
||||
@ -212,7 +212,7 @@ void proxy_client_reset_nick(CLIENT_REC *client)
|
||||
g_strcmp0(client->nick, client->server->nick) == 0)
|
||||
return;
|
||||
|
||||
proxy_outdata(client, ":%s!proxy NICK :%s\n",
|
||||
proxy_outdata(client, ":%s!proxy NICK :%s\r\n",
|
||||
client->nick, client->server->nick);
|
||||
|
||||
g_free(client->nick);
|
||||
@ -236,13 +236,13 @@ void proxy_dump_data(CLIENT_REC *client)
|
||||
proxy_client_reset_nick(client);
|
||||
|
||||
/* welcome info */
|
||||
proxy_outdata(client, ":%s 001 %s :Welcome to the Internet Relay Network %s!%s@proxy\n", client->proxy_address, client->nick, client->nick, settings_get_str("user_name"));
|
||||
proxy_outdata(client, ":%s 002 %s :Your host is irssi-proxy, running version %s\n", client->proxy_address, client->nick, PACKAGE_VERSION);
|
||||
proxy_outdata(client, ":%s 003 %s :This server was created ...\n", client->proxy_address, client->nick);
|
||||
proxy_outdata(client, ":%s 001 %s :Welcome to the Internet Relay Network %s!%s@proxy\r\n", client->proxy_address, client->nick, client->nick, settings_get_str("user_name"));
|
||||
proxy_outdata(client, ":%s 002 %s :Your host is irssi-proxy, running version %s\r\n", client->proxy_address, client->nick, PACKAGE_VERSION);
|
||||
proxy_outdata(client, ":%s 003 %s :This server was created ...\r\n", client->proxy_address, client->nick);
|
||||
if (client->server == NULL || !client->server->emode_known)
|
||||
proxy_outdata(client, ":%s 004 %s %s %s oirw abiklmnopqstv\n", client->proxy_address, client->nick, client->proxy_address, PACKAGE_VERSION);
|
||||
proxy_outdata(client, ":%s 004 %s %s %s oirw abiklmnopqstv\r\n", client->proxy_address, client->nick, client->proxy_address, PACKAGE_VERSION);
|
||||
else
|
||||
proxy_outdata(client, ":%s 004 %s %s %s oirw abeIiklmnopqstv\n", client->proxy_address, client->nick, client->proxy_address, PACKAGE_VERSION);
|
||||
proxy_outdata(client, ":%s 004 %s %s %s oirw abeIiklmnopqstv\r\n", client->proxy_address, client->nick, client->proxy_address, PACKAGE_VERSION);
|
||||
|
||||
if (client->server != NULL && client->server->isupport_sent) {
|
||||
isupport_out = g_string_new(NULL);
|
||||
@ -267,7 +267,7 @@ void proxy_dump_data(CLIENT_REC *client)
|
||||
count = 0;
|
||||
if (paramstr->len > 0)
|
||||
g_string_truncate(paramstr, paramstr->len-1);
|
||||
g_string_append_printf(paramstr, " :are supported by this server\n");
|
||||
g_string_append_printf(paramstr, " :are supported by this server\r\n");
|
||||
proxy_outdata(client, "%s", paramstr->str);
|
||||
g_string_truncate(paramstr, 0);
|
||||
g_string_printf(paramstr, ":%s 005 %s ", client->proxy_address, client->nick);
|
||||
@ -281,9 +281,9 @@ void proxy_dump_data(CLIENT_REC *client)
|
||||
g_strfreev(paramlist);
|
||||
}
|
||||
|
||||
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);
|
||||
proxy_outdata(client, ":%s 251 %s :There are 0 users and 0 invisible on 1 servers\r\n", client->proxy_address, client->nick);
|
||||
proxy_outdata(client, ":%s 255 %s :I have 0 clients, 0 services and 0 servers\r\n", client->proxy_address, client->nick);
|
||||
proxy_outdata(client, ":%s 422 %s :MOTD File is missing\r\n", client->proxy_address, client->nick);
|
||||
|
||||
/* user mode / away status */
|
||||
if (client->server != NULL) {
|
||||
@ -293,7 +293,7 @@ void proxy_dump_data(CLIENT_REC *client)
|
||||
client->server->usermode);
|
||||
}
|
||||
if (client->server->usermode_away) {
|
||||
proxy_outdata(client, ":%s 306 %s :You have been marked as being away\n",
|
||||
proxy_outdata(client, ":%s 306 %s :You have been marked as being away\r\n",
|
||||
client->proxy_address, client->nick);
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
|
||||
if (*target == '\0' ||
|
||||
g_ascii_strcasecmp(target, client->proxy_address) == 0 ||
|
||||
g_ascii_strcasecmp(target, client->nick) == 0) {
|
||||
proxy_outdata(client, ":%s PONG %s :%s\n",
|
||||
proxy_outdata(client, ":%s PONG %s :%s\r\n",
|
||||
client->proxy_address,
|
||||
client->proxy_address, origin);
|
||||
g_free(params);
|
||||
@ -174,18 +174,18 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
|
||||
/* kludgy way to check if the clients aren't the same */
|
||||
(client->recv_tag != rec->recv_tag)) {
|
||||
if (rec->want_ctcp == 1)
|
||||
proxy_outdata(rec, ":%s NOTICE %s :Another client is now receiving CTCPs sent to %s\n",
|
||||
proxy_outdata(rec, ":%s NOTICE %s :Another client is now receiving CTCPs sent to %s\r\n",
|
||||
rec->proxy_address, rec->nick, rec->listen->ircnet);
|
||||
rec->want_ctcp = 0;
|
||||
}
|
||||
|
||||
}
|
||||
proxy_outdata(client, ":%s NOTICE %s :You're now receiving CTCPs sent to %s\n",
|
||||
proxy_outdata(client, ":%s NOTICE %s :You're now receiving CTCPs sent to %s\r\n",
|
||||
client->proxy_address, client->nick,client->listen->ircnet);
|
||||
} else if (g_ascii_strcasecmp(args, "CTCP OFF") == 0) {
|
||||
/* client wants proxy to handle all ctcps */
|
||||
client->want_ctcp = 0;
|
||||
proxy_outdata(client, ":%s NOTICE %s :Proxy is now handling itself CTCPs sent to %s\n",
|
||||
proxy_outdata(client, ":%s NOTICE %s :Proxy is now handling itself CTCPs sent to %s\r\n",
|
||||
client->proxy_address, client->nick, client->listen->ircnet);
|
||||
} else {
|
||||
signal_emit("proxy client command", 3, client, args, data);
|
||||
@ -194,7 +194,7 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
|
||||
}
|
||||
|
||||
if (client->server == NULL || !client->server->connected) {
|
||||
proxy_outdata(client, ":%s NOTICE %s :Not connected to server\n",
|
||||
proxy_outdata(client, ":%s NOTICE %s :Not connected to server\r\n",
|
||||
client->proxy_address, client->nick);
|
||||
return;
|
||||
}
|
||||
@ -371,7 +371,7 @@ static void sig_incoming(IRC_SERVER_REC *server, const char *line)
|
||||
g_return_if_fail(line != NULL);
|
||||
|
||||
/* send server event to all clients */
|
||||
g_string_printf(next_line, "%s\n", line);
|
||||
g_string_printf(next_line, "%s\r\n", line);
|
||||
}
|
||||
|
||||
static void sig_server_event(IRC_SERVER_REC *server, const char *line,
|
||||
@ -465,7 +465,7 @@ static void event_connected(IRC_SERVER_REC *server)
|
||||
(g_strcmp0(rec->listen->ircnet, "*") == 0 ||
|
||||
(chatnet != NULL &&
|
||||
g_ascii_strcasecmp(chatnet, rec->listen->ircnet) == 0))) {
|
||||
proxy_outdata(rec, ":%s NOTICE %s :Connected to server\n",
|
||||
proxy_outdata(rec, ":%s NOTICE %s :Connected to server\r\n",
|
||||
rec->proxy_address, rec->nick);
|
||||
rec->server = server;
|
||||
proxy_client_reset_nick(rec);
|
||||
@ -478,7 +478,7 @@ static void proxy_server_disconnected(CLIENT_REC *client,
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
proxy_outdata(client, ":%s NOTICE %s :Connection lost to server %s\n",
|
||||
proxy_outdata(client, ":%s NOTICE %s :Connection lost to server %s\r\n",
|
||||
client->proxy_address, client->nick,
|
||||
server->connrec->address);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user