found a way to avoid requesting all the MUCs history alltogether on startup

This commit is contained in:
Blue 2020-08-09 19:28:03 +03:00
parent 3a120c773a
commit ef1a9846bf
4 changed files with 34 additions and 6 deletions

View file

@ -248,18 +248,22 @@ void Core::RosterItem::appendMessageToArchive(const Shared::Message& msg)
}
break;
case beginning:
appendCache.push_back(msg);
if (!syncronizing) {
requestHistory(-1, getId(msg));
if (!archive->hasElement(msg.getId())) {
appendCache.push_back(msg);
if (!syncronizing) {
requestHistory(-1, getId(msg));
}
}
break;
case end:
archive->addElement(msg);
break;
case chunk:
appendCache.push_back(msg);
if (!syncronizing) {
requestHistory(-1, getId(msg));
if (!archive->hasElement(msg.getId())) {
appendCache.push_back(msg);
if (!syncronizing) {
requestHistory(-1, getId(msg));
}
}
break;
case complete: