mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(history): don't save own messages when history is disabled
Fix #5036
This commit is contained in:
parent
7627d60a89
commit
b852809d0c
|
@ -230,6 +230,10 @@ void History::addNewMessage(const QString& friendPk, const QString& message, con
|
||||||
const QDateTime& time, bool isSent, QString dispName,
|
const QDateTime& time, bool isSent, QString dispName,
|
||||||
const std::function<void(int64_t)>& insertIdCallback)
|
const std::function<void(int64_t)>& insertIdCallback)
|
||||||
{
|
{
|
||||||
|
if (!Settings::getInstance().getEnableLogging()) {
|
||||||
|
qWarning() << "Blocked a message from being added to database while history is disabled";
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!isValid()) {
|
if (!isValid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -984,7 +984,7 @@ void ChatForm::SendMessageStr(QString msg)
|
||||||
uint32_t friendId = f->getId();
|
uint32_t friendId = f->getId();
|
||||||
int rec = isAction ? core->sendAction(friendId, part) : core->sendMessage(friendId, part);
|
int rec = isAction ? core->sendAction(friendId, part) : core->sendMessage(friendId, part);
|
||||||
|
|
||||||
if (history) {
|
if (history && Settings::getInstance().getEnableLogging()) {
|
||||||
auto* offMsgEngine = getOfflineMsgEngine();
|
auto* offMsgEngine = getOfflineMsgEngine();
|
||||||
QString selfPk = Core::getInstance()->getSelfId().toString();
|
QString selfPk = Core::getInstance()->getSelfId().toString();
|
||||||
QString pk = f->getPublicKey().toString();
|
QString pk = f->getPublicKey().toString();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user