1
0
Fork 0
forked from blue/squawk

some progress on history

This commit is contained in:
Blue 2019-04-21 22:17:04 +03:00
parent 6124c46a1c
commit aa1f728da9
6 changed files with 258 additions and 7 deletions

View file

@ -427,8 +427,30 @@ void Core::Account::onMamMessageReceived(const QString& bareJid, const QXmppMess
handleChatMessage(msg, false, true, true);
}
void Core::Account::requestAchive(const QString& jid)
void Core::Account::requestArchive(const QString& jid, int count, const QString& before)
{
std::map<QString, Contact*>::const_iterator itr = contacts.find(jid);
if (itr == contacts.end()) {
qDebug() << "An attempt to request archive for" << jid << "in account" << name << ", but the contact with such id wasn't found, skipping";
return;
}
Contact* contact = itr->second;
contact->requestHistory(count, before);
Contact::ArchiveState as = contact->getArchiveState();
switch (as) {
case Contact::empty:
break;
case Contact::beginning:
break;
case Contact::chunk:
break;
case Contact::complete:
break;
case Contact::end:
break;
}
QXmppResultSetQuery query;
query.setMax(100);
QDateTime from = QDateTime::currentDateTime().addDays(-7);