removed Order, resolved a crash on several files being uploaded simultaniuosly
This commit is contained in:
parent
0a530bfa93
commit
be466fbad1
12 changed files with 122 additions and 304 deletions
|
@ -141,14 +141,13 @@ Core::Account::Account(
|
|||
loadingOmemo = true;
|
||||
future.then(this, [this] (bool result) {
|
||||
loadingOmemo = false;
|
||||
if (state == Shared::ConnectionState::scheduled) {
|
||||
if (state == Shared::ConnectionState::scheduled)
|
||||
client.connectToServer(config, presence);
|
||||
}
|
||||
if (result) {
|
||||
|
||||
if (result)
|
||||
qDebug() << "successfully loaded OMEMO data for account" << getName();
|
||||
} else {
|
||||
else
|
||||
qDebug() << "couldn't load OMEMO data for account" << getName();
|
||||
}
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@ Core::Archive::Archive(const QString& account, const QString& p_jid, QObject* pa
|
|||
opened(false),
|
||||
db(account + "/" + jid),
|
||||
messages(db.addStorage<QString, Shared::Message>("messages")),
|
||||
order(db.addStorage<uint64_t, QString>("order")),
|
||||
order(db.addStorage<uint64_t, QString>("order", true)),
|
||||
stats(db.addStorage<QString, QVariant>("stats")),
|
||||
avatars(db.addStorage<QString, AvatarInfo>("avatars")),
|
||||
stanzaIdToId(db.addStorage<QString, QString>("stanzaIdToId")),
|
||||
|
|
|
@ -51,8 +51,7 @@ void Core::MessageHandler::onMessageReceived(const QXmppMessage& msg) {
|
|||
qDebug() << "Account" << acc->getName() << "received an Omemo1 encrypted message, not supported yet";
|
||||
break; //let it go the way it is, there is nothing I can do yet
|
||||
case QXmpp::Omemo2:
|
||||
qDebug() << "Account" << acc->getName() << "received an Omemo2 encrypted message, not supported yet";
|
||||
break; //let it go the way it is, there is nothing I can do yet
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -359,6 +358,8 @@ std::pair<Shared::Message::State, QString> Core::MessageHandler::scheduleSending
|
|||
const QXmppE2eeExtension::MessageEncryptResult& res = task.result();
|
||||
if (std::holds_alternative<std::unique_ptr<QXmppMessage>>(res)) {
|
||||
const std::unique_ptr<QXmppMessage>& encrypted = std::get<std::unique_ptr<QXmppMessage>>(res);
|
||||
encrypted->setBody("This message is encrypted with OMEMO 2 but could not be decrypted");
|
||||
encrypted->setOutOfBandUrl("");
|
||||
bool success = acc->client.sendPacket(*encrypted.get());
|
||||
if (success)
|
||||
return {Shared::Message::State::sent, ""};
|
||||
|
@ -375,6 +376,7 @@ std::pair<Shared::Message::State, QString> Core::MessageHandler::scheduleSending
|
|||
if (std::holds_alternative<std::unique_ptr<QXmppMessage>>(result)) {
|
||||
const std::unique_ptr<QXmppMessage>& encrypted = std::get<std::unique_ptr<QXmppMessage>>(result);
|
||||
encrypted->setBody("This message is encrypted with OMEMO 2 but could not be decrypted");
|
||||
encrypted->setOutOfBandUrl("");
|
||||
bool success = acc->client.sendPacket(*encrypted.get());
|
||||
if (success) {
|
||||
std::tuple<bool, QString, QString> ids = getOriginalPendingMessageId(id, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue