For nick change messages, use the new nickname for calculating the
sender hash, not the old one. This more closely matches
expectations.
Works around a limitation in the Quassel theming engine that doesn't
allow different styling for multiple nicks in one message.
Unfortunately, rewriting the necessary parts of the theme engine to
support multiple styles per nick is above my understanding right now.
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) == '_')