From 9d5ef17bd66a91b8023e428e316d039e31f5f858 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 9 Jul 2007 09:14:51 +0000 Subject: [PATCH] Fixed bug with smart nick completion (last speakers first) when a nick is changed --- ChangeLog | 4 +++- src/irc/irc-nick.c | 11 +++++++++++ weechat/ChangeLog | 4 +++- weechat/src/irc/irc-nick.c | 11 +++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47f7ad80f..a1fe8e1e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2007-07-08 +ChangeLog - 2007-07-09 Version 0.2.6 (under dev!): + * fixed bug with smart nick completion (last speakers first) when a nick + is changed * fixed charset bug with channel names in status bar (bug #20400) * added "scroll" option to /buffer command * down key now saves input to history and clears input line (task #7049) diff --git a/src/irc/irc-nick.c b/src/irc/irc-nick.c index c631dc7ff..0b69a08a2 100644 --- a/src/irc/irc-nick.c +++ b/src/irc/irc-nick.c @@ -250,8 +250,19 @@ void irc_nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick) { int nick_is_me; + t_weelist *ptr_weelist; nick_is_me = (strcmp (nick->nick, SERVER(channel->buffer)->nick) == 0) ? 1 : 0; + + if (!nick_is_me && channel->nicks_speaking) + { + ptr_weelist = weelist_search (channel->nicks_speaking, nick->nick); + if (ptr_weelist && ptr_weelist->data) + { + free (ptr_weelist->data); + ptr_weelist->data = strdup (new_nick); + } + } /* change nickname */ if (nick->nick) diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 47f7ad80f..a1fe8e1e1 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2007-07-08 +ChangeLog - 2007-07-09 Version 0.2.6 (under dev!): + * fixed bug with smart nick completion (last speakers first) when a nick + is changed * fixed charset bug with channel names in status bar (bug #20400) * added "scroll" option to /buffer command * down key now saves input to history and clears input line (task #7049) diff --git a/weechat/src/irc/irc-nick.c b/weechat/src/irc/irc-nick.c index c631dc7ff..0b69a08a2 100644 --- a/weechat/src/irc/irc-nick.c +++ b/weechat/src/irc/irc-nick.c @@ -250,8 +250,19 @@ void irc_nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick) { int nick_is_me; + t_weelist *ptr_weelist; nick_is_me = (strcmp (nick->nick, SERVER(channel->buffer)->nick) == 0) ? 1 : 0; + + if (!nick_is_me && channel->nicks_speaking) + { + ptr_weelist = weelist_search (channel->nicks_speaking, nick->nick); + if (ptr_weelist && ptr_weelist->data) + { + free (ptr_weelist->data); + ptr_weelist->data = strdup (new_nick); + } + } /* change nickname */ if (nick->nick)