fixed resub messages

This commit is contained in:
fourtf
2018-06-04 12:23:23 +02:00
parent 04b7cc5ce8
commit 4a2709cbc3
14 changed files with 141 additions and 36 deletions
+2
View File
@@ -225,6 +225,8 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/, Selectio
QColor backgroundColor;
if (this->message_->flags & Message::Highlighted) {
backgroundColor = app->themes->messages.backgrounds.highlighted;
} else if (this->message_->flags & Message::Subscription) {
backgroundColor = app->themes->messages.backgrounds.subscription;
} else if (app->settings->alternateMessageBackground.getValue() &&
this->flags & MessageLayout::AlternateBackground) {
backgroundColor = app->themes->messages.backgrounds.alternate;
+14 -1
View File
@@ -21,6 +21,8 @@ SBHighlight Message::getScrollBarHighlight() const
{
if (this->flags & Message::Highlighted) {
return SBHighlight(SBHighlight::Highlight);
} else if (this->flags & Message::Subscription) {
return SBHighlight(SBHighlight::Subscription);
}
return SBHighlight();
}
@@ -39,6 +41,17 @@ MessagePtr Message::createSystemMessage(const QString &text)
return message;
}
MessagePtr Message::createMessage(const QString &text)
{
MessagePtr message(new Message);
message->addElement(new TimestampElement(QTime::currentTime()));
message->addElement(new TextElement(text, MessageElement::Text, MessageColor::Text));
message->searchText = text;
return message;
}
MessagePtr Message::createTimeoutMessage(const QString &username, const QString &durationInSeconds,
const QString &reason, bool multipleTimes)
{
@@ -64,7 +77,7 @@ MessagePtr Message::createTimeoutMessage(const QString &username, const QString
if (reason.length() > 0) {
text.append(": \"");
text.append(util::ParseTagString(reason));
text.append(util::parseTagString(reason));
text.append("\"");
}
text.append(".");
+2
View File
@@ -41,6 +41,7 @@ struct Message {
DisconnectedMessage = (1 << 8),
Untimeout = (1 << 9),
PubSub = (1 << 10),
Subscription = (1 << 11),
};
util::FlagsEnum<MessageFlags> flags;
@@ -66,6 +67,7 @@ private:
public:
static std::shared_ptr<Message> createSystemMessage(const QString &text);
static std::shared_ptr<Message> createMessage(const QString &text);
static std::shared_ptr<Message> createTimeoutMessage(const QString &username,
const QString &durationInSeconds,
+1
View File
@@ -7,6 +7,7 @@ struct MessageParseArgs {
bool disablePingSounds = false;
bool isReceivedWhisper = false;
bool isSentWhisper = false;
bool trimSubscriberUsername = false;
};
} // namespace messages