diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 18934d6..7448ad8 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -690,12 +690,7 @@ quint8 UiStyle::StyledMessage::senderHash() const { return _senderHash; QString nick = nickFromMask(sender()).toLower(); - if(!nick.isEmpty()) { - int chopCount = 0; - while(nick.at(nick.count() - 1 - chopCount) == '_') - chopCount++; - nick.chop(chopCount); - } + nick.truncate(nick.indexOf(QRegExp("_+$"), 1)); quint16 hash = qChecksum(nick.toAscii().data(), nick.toAscii().size()); return (_senderHash = (hash & 0xf) + 1); }