-rw-r--r-- | noncore/net/opieirc/ircsession.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp index c8d7869..d87ff80 100644 --- a/noncore/net/opieirc/ircsession.cpp +++ b/noncore/net/opieirc/ircsession.cpp @@ -131,28 +131,30 @@ void IRCSession::updateNickname(const QString &oldNickname, const QString &newNi if(!person) { emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person"))); return; } getChannelsByPerson(person, channels); output = IRCOutput(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg(oldNickname).arg(newNickname)); } QListIterator<IRCChannel> it(channels); for (;it.current(); ++it) { IRCChannelPerson *chanperson = it.current()->getPerson(oldNickname); + if (chanperson) { it.current()->removePerson(chanperson); chanperson->setNick(newNickname); it.current()->addPerson(chanperson); } + } emit updateChannels(); output.addParam(new QString(newNickname)); emit outputReady(output); } IRCChannel *IRCSession::getChannel(QString channelname) { QListIterator<IRCChannel> it(m_channels); for (; it.current(); ++it) { if (it.current()->channelname() == channelname) { return it.current(); } |