1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

batch processing

This commit is contained in:
apprb 2014-11-13 11:30:29 +09:00
parent 9d96110e9b
commit e782a9d587
No known key found for this signature in database
GPG Key ID: B001911B5B22FB9B

View File

@ -147,10 +147,12 @@ int HistoryKeeper::addChatEntry(const QString& chat, const QString& message, con
int chat_id = getChatID(chat, ctSingle).first;
int sender_id = getAliasID(sender);
db->exec("BEGIN TRANSACTION");
db->exec(QString("INSERT INTO history (timestamp, chat_id, sender, message)") +
QString("VALUES (%1, %2, %3, '%4');")
.arg(dt.toMSecsSinceEpoch()).arg(chat_id).arg(sender_id).arg(wrapMessage(message)));
db->exec(QString("INSERT INTO sent_status (status) VALUES (%1)").arg(isSent));
db->exec("COMMIT TRANSACTION");
messageID++;
return messageID;