Commit 8bc9708a authored by Romain Bignon's avatar Romain Bignon

fixup nickname when a chat buddy is renamed

parent 7046aecd
......@@ -116,12 +116,15 @@ void ConversationChannel::renameBuddy(ChanUser* chanuser, im::ChatBuddy cbuddy)
{
ChatBuddy* nick = dynamic_cast<irc::ChatBuddy*>(chanuser->getNick());
string new_nick = cbuddy.getName();
string new_nick = nick->nickize(cbuddy.getName());
while(irc->getNick(new_nick))
new_nick += "_";
irc->getUser()->send(irc::Message(MSG_NICK).setSender(nick)
.addArg(new_nick));
irc->renameNick(nick, new_nick);
if (nick->getNickname() != new_nick) {
irc->getUser()->send(irc::Message(MSG_NICK).setSender(nick)
.addArg(new_nick));
irc->renameNick(nick, new_nick);
}
cbuddies.erase(nick->getChatBuddy());
nick->setChatBuddy(cbuddy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment