Text message "CTextMessageList::markedAsSent"

This commit is contained in:
Klaus Basan
2019-10-19 01:29:24 +02:00
parent f26b85f493
commit ca149d78c0
2 changed files with 11 additions and 0 deletions

View File

@@ -150,6 +150,14 @@ namespace BlackMisc
std::for_each(this->begin(), this->end(), [](CTextMessage & tm) { tm.markAsSent(); });
}
CTextMessageList CTextMessageList::markedAsSent()
{
if (this->isEmpty()) { return {}; }
CTextMessageList copy = *this;
copy.markAsSent();
return copy;
}
void CTextMessageList::addConsolidatedTextMessage(const CTextMessage &message)
{
if (message.isEmpty()) { return; }

View File

@@ -100,6 +100,9 @@ namespace BlackMisc
//! Mark all messages as sent
void markAsSent();
//! Marked as sent
CTextMessageList markedAsSent();
//! Add a text message, but append it to an existing message if possible
void addConsolidatedTextMessage(const CTextMessage &message);
};