X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=f35543de50a66e3bfa5869544ee61a8334965909;hp=6c6e999d1ea4c751c382804eb3801c1835d9001a;hb=e3a91437981155e3657284cbd850c22c6522817b;hpb=cbe2482dca16e13aa3a170213f299179d20526af diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 6c6e999d..f35543de 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -961,7 +961,19 @@ quint8 UiStyle::StyledMessage::senderHash() const if (_senderHash != 0xff) return _senderHash; - QString nick = nickFromMask(sender()).toLower(); + QString nick; + + // HACK: Until multiple nicknames with different colors can be solved in the theming engine, + // for /nick change notifications, use the color of the new nickname (if possible), not the old + // nickname. + if (type() == Message::Nick) { + // New nickname is given as contents. Change to that. + nick = stripFormatCodes(contents()).toLower(); + } else { + // Just use the sender directly + nick = nickFromMask(sender()).toLower(); + } + if (!nick.isEmpty()) { int chopCount = 0; while (chopCount < nick.size() && nick.at(nick.count() - 1 - chopCount) == '_')