1
0
forked from bip/bip

Fix double arrow prefix for self issued private messages when more that

two clients are connected.
This commit is contained in:
Arnaud Cornet 2007-12-08 16:00:50 +01:00
parent 95586c79e3
commit 1a9a72432b

View File

@ -1145,7 +1145,7 @@ static void irc_copy_cli(struct link_client *src, struct link_client *dest,
/* LINK(src) == LINK(dest) */ /* LINK(src) == LINK(dest) */
size_t len = strlen(line->elemv[2]) + 5; size_t len = strlen(line->elemv[2]) + 5;
char *tmp; char *tmp, *oldelem;
if (len == 0) if (len == 0)
return; return;
@ -1159,13 +1159,15 @@ static void irc_copy_cli(struct link_client *src, struct link_client *dest,
/* tricky: */ /* tricky: */
line->elemv[1] = LINK(src)->l_server->nick; line->elemv[1] = LINK(src)->l_server->nick;
free(line->elemv[2]); oldelem = line->elemv[2];
line->elemv[2] = tmp; line->elemv[2] = tmp;
str = irc_line_to_string(line); str = irc_line_to_string(line);
/* end of trick: */ /* end of trick: */
line->elemv[1] = line->origin; line->elemv[1] = line->origin;
line->elemv[2] = oldelem;
line->origin = NULL; line->origin = NULL;
write_line(CONN(dest), str); write_line(CONN(dest), str);
free(tmp);
free(str); free(str);
return; return;
} }