Diffstat (limited to 'noncore/net/opieirc/ircmessageparser.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 6b88f34..400ff41 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -208,4 +208,5 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | |||
208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | 208 | void IRCMessageParser::parseLiteralNick(IRCMessage *message) { |
209 | IRCPerson mask(message->prefix()); | ||
210 | 209 | ||
210 | IRCPerson mask(message->prefix()); | ||
211 | /* this way of handling nick changes really sucks */ | ||
211 | if (mask.nick() == m_session->m_server->nick()) { | 212 | if (mask.nick() == m_session->m_server->nick()) { |
@@ -220,2 +221,13 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
220 | if (person) { | 221 | if (person) { |
222 | //IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0))); | ||
223 | |||
224 | /* new code starts here -- this removes the person from all channels */ | ||
225 | QList<IRCChannel> channels; | ||
226 | m_session->getChannelsByPerson(person, channels); | ||
227 | QListIterator<IRCChannel> it(channels); | ||
228 | for (;it.current(); ++it) { | ||
229 | IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); | ||
230 | it.current()->removePerson(chanperson); | ||
231 | chanperson->person->setNick(message->param(0)); | ||
232 | it.current()->addPerson(chanperson); | ||
221 | IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0 ))); | 233 | IRCOutput output(OUTPUT_NICKCHANGE, tr("%1 is now known as %2").arg( mask.nick() ).arg( message->param(0 ))); |
@@ -223,2 +235,4 @@ void IRCMessageParser::parseLiteralNick(IRCMessage *message) { | |||
223 | emit outputReady(output); | 235 | emit outputReady(output); |
236 | } | ||
237 | /* new code ends here */ | ||
224 | } else { | 238 | } else { |
@@ -399,2 +413,3 @@ void IRCMessageParser::parseLiteralKick(IRCMessage *message) { | |||
399 | } else { | 413 | } else { |
414 | /* someone else got kicked */ | ||
400 | channel->removePerson(person); | 415 | channel->removePerson(person); |