Version 4.6.2: Fix ghost drafts appearing in channels.

This commit is contained in:
John Preston 2023-02-08 15:48:05 +04:00
parent 84b4ab1c3c
commit ee1162faff
2 changed files with 8 additions and 5 deletions

View file

@ -1867,11 +1867,11 @@ void HistoryWidget::fastShowAtEnd(not_null<History*> history) {
}
}
void HistoryWidget::applyDraft(FieldHistoryAction fieldHistoryAction) {
bool HistoryWidget::applyDraft(FieldHistoryAction fieldHistoryAction) {
InvokeQueued(this, [=] { updateStickersByEmoji(); });
if (_voiceRecordBar->isActive() || !_canSendTexts) {
return;
return false;
}
const auto editDraft = _history ? _history->localEditDraft({}) : nullptr;
@ -1893,7 +1893,7 @@ void HistoryWidget::applyDraft(FieldHistoryAction fieldHistoryAction) {
updateControlsGeometry();
}
refreshTopBarActiveChat();
return;
return true;
}
_textUpdateEvents = 0;
@ -1930,6 +1930,7 @@ void HistoryWidget::applyDraft(FieldHistoryAction fieldHistoryAction) {
_processingReplyId = draft ? draft->msgId : MsgId();
processReply();
}
return true;
}
void HistoryWidget::applyCloudDraft(History *history) {
@ -2261,7 +2262,9 @@ void HistoryWidget::showHistory(
handlePeerUpdate();
session().local().readDraftsWithCursors(_history);
applyDraft();
if (!applyDraft()) {
clearFieldText();
}
_send->finishAnimating();
updateControlsGeometry();

View file

@ -213,7 +213,7 @@ public:
void botCallbackSent(not_null<HistoryItem*> item);
void fastShowAtEnd(not_null<History*> history);
void applyDraft(
bool applyDraft(
FieldHistoryAction fieldHistoryAction = FieldHistoryAction::Clear);
void showHistory(const PeerId &peer, MsgId showAtMsgId, bool reload = false);
void setChooseReportMessagesDetails(