Ref T190, text messages can be appended

(same sender sends one message in multiple parts)
This commit is contained in:
Klaus Basan
2017-11-11 23:26:34 +01:00
parent 0a1f5c49ae
commit 48adb52082
4 changed files with 42 additions and 0 deletions

View File

@@ -109,5 +109,14 @@ namespace BlackMisc
std::for_each(this->begin(), this->end(), [](CTextMessage & tm) { tm.markAsSent(); });
}
void CTextMessageList::addConsolidatedTextMessage(const CTextMessage &message)
{
if (message.isEmpty()) { return; }
for (CTextMessage &tm : *this)
{
if (tm.appendIfPossible(message)) { return; }
}
this->push_back(message);
}
} // namespace
} // namespace