summaryrefslogtreecommitdiff
path: root/src/irc/irc-recv.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2004-03-27 15:09:36 +0000
committerSebastien Helleu <flashcode@flashtux.org>2004-03-27 15:09:36 +0000
commit35d6c43f85833b235cab22f7565669c46409cc84 (patch)
treead06d5274215b3ed0f2747c4b525c978e4ab081d /src/irc/irc-recv.c
parentdb235b23fa1fdfcff1631975d28a80c4733ca97a (diff)
downloadweechat-35d6c43f85833b235cab22f7565669c46409cc84.zip
Fixed bug when opened private win and remote user changes his nick
Diffstat (limited to 'src/irc/irc-recv.c')
-rw-r--r--src/irc/irc-recv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 004dfe3a1..6239b5ebc 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -602,6 +602,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
int nick_is_me;
+ t_gui_window *ptr_window;
/* no host => we can't identify sender of message! */
if (host == NULL)
@@ -623,6 +624,21 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
ptr_nick = nick_search (ptr_channel, host);
if (ptr_nick)
{
+ /* change nickname in any opened private window */
+ for (ptr_window = gui_windows; ptr_window;
+ ptr_window = ptr_window->next_window)
+ {
+ if ((SERVER(ptr_window) == server) && WIN_IS_PRIVATE(ptr_window))
+ {
+ if (CHANNEL(ptr_window)->name)
+ {
+ free (CHANNEL(ptr_window)->name);
+ CHANNEL(ptr_window)->name = strdup (arguments);
+ }
+ }
+ }
+
+ /* change nickname on channel */
nick_is_me = (strcmp (ptr_nick->nick, server->nick) == 0) ? 1 : 0;
nick_change (ptr_channel, ptr_nick, arguments);
irc_display_prefix (ptr_channel->window, PREFIX_INFO);
@@ -655,6 +671,7 @@ irc_cmd_recv_nick (t_irc_server *server, char *host, char *arguments)
free (server->nick);
server->nick = strdup (arguments);
}
+ gui_redraw_window_status (gui_current_window);
gui_redraw_window_input (gui_current_window);
return 0;