@@ -29,9 +29,10 @@ Message::Message(const QString &text)
|
||||
}
|
||||
*/
|
||||
|
||||
Message::Message(const QString &text, const std::vector<Word> &words)
|
||||
Message::Message(const QString &text, const std::vector<Word> &words, const bool &highlight)
|
||||
: text(text)
|
||||
, words(words)
|
||||
, highlightTab(highlight)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Message
|
||||
{
|
||||
public:
|
||||
// explicit Message(const QString &text);
|
||||
explicit Message(const QString &text, const std::vector<messages::Word> &words);
|
||||
explicit Message(const QString &text, const std::vector<messages::Word> &words, const bool &highlight);
|
||||
|
||||
bool getCanHighlightTab() const;
|
||||
const QString &getTimeoutUser() const;
|
||||
|
||||
@@ -16,7 +16,7 @@ MessageBuilder::MessageBuilder()
|
||||
|
||||
SharedMessage MessageBuilder::build()
|
||||
{
|
||||
return SharedMessage(new Message(this->originalMessage, _words));
|
||||
return SharedMessage(new Message(this->originalMessage, _words,highlight));
|
||||
}
|
||||
|
||||
void MessageBuilder::appendWord(const Word &word)
|
||||
@@ -31,6 +31,10 @@ void MessageBuilder::appendTimestamp()
|
||||
appendTimestamp(t);
|
||||
}
|
||||
|
||||
void MessageBuilder::setHighlight(const bool &value){
|
||||
highlight = value;
|
||||
}
|
||||
|
||||
void MessageBuilder::appendTimestamp(time_t time)
|
||||
{
|
||||
char timeStampBuffer[69];
|
||||
|
||||
@@ -18,6 +18,7 @@ public:
|
||||
void appendWord(const Word &word);
|
||||
void appendTimestamp();
|
||||
void appendTimestamp(std::time_t time);
|
||||
void setHighlight(const bool &value);
|
||||
|
||||
QString matchLink(const QString &string);
|
||||
QRegularExpression regex;
|
||||
@@ -26,6 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
std::vector<Word> _words;
|
||||
bool highlight = false;
|
||||
std::chrono::time_point<std::chrono::system_clock> _parseTime;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user