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:
@@ -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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user