2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Skip draft updates while sending with clear_draft.

I hope fixes #4845, fixes #4852, fixes #4861.
This commit is contained in:
John Preston
2018-06-26 16:59:05 +01:00
parent 33095966af
commit 372cf275e0
3 changed files with 23 additions and 10 deletions

View File

@@ -409,9 +409,9 @@ Data::Draft *History::createCloudDraft(Data::Draft *fromDraft) {
}
bool History::skipCloudDraft(const QString &text, TimeId date) const {
if (_lastSentDraftText && *_lastSentDraftText == text) {
if (date > 0 && date <= _lastSentDraftTime + kSkipCloudDraftsFor) {
return true;
} else if (date <= _lastSentDraftTime + kSkipCloudDraftsFor) {
} else if (_lastSentDraftText && *_lastSentDraftText == text) {
return true;
}
return false;
@@ -421,8 +421,10 @@ void History::setSentDraftText(const QString &text) {
_lastSentDraftText = text;
}
void History::clearSentDraftText() {
_lastSentDraftText = base::none;
void History::clearSentDraftText(const QString &text) {
if (_lastSentDraftText && *_lastSentDraftText == text) {
_lastSentDraftText = base::none;
}
accumulate_max(_lastSentDraftTime, unixtime());
}