Calculate senderHash for Action messages
authorShane Synan <digitalcircuit36939@gmail.com>
Fri, 17 Jun 2016 01:16:40 +0000 (21:16 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 6 Sep 2016 20:14:48 +0000 (22:14 +0200)
Fixes stylesheets not being able to reference sender hashes in Qss
selectors.

Allows the following to work:
ChatLine::nick#action[sender="00"]   { foreground: #e90d7f; }

Just like this currently works:
ChatLine::nick#plain[sender="00"] { foreground: #e90d7f; }

src/uisupport/uistyle.cpp

index cba2eda..f55b183 100644 (file)
@@ -667,10 +667,11 @@ QString UiStyle::mircToInternal(const QString &mirc_)
 UiStyle::StyledMessage::StyledMessage(const Message &msg)
     : Message(msg)
 {
 UiStyle::StyledMessage::StyledMessage(const Message &msg)
     : Message(msg)
 {
-    if (type() == Message::Plain)
+    if (type() == Message::Plain || type() == Message::Action)
         _senderHash = 0xff;
     else
         _senderHash = 0xff;
     else
-        _senderHash = 0x00;  // this means we never compute the hash for msgs that aren't plain
+        _senderHash = 0x00;
+    // This means we never compute the hash for msgs that aren't Plain or Action
 }
 
 
 }