mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Don't drop reply info on empty message submit.
This commit is contained in:
@@ -842,7 +842,9 @@ HistoryWidget::HistoryWidget(
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
fastShowAtEnd(action.history);
|
fastShowAtEnd(action.history);
|
||||||
if (cancelReply(lastKeyboardUsed) && !action.clearDraft) {
|
if (!_justMarkingAsRead
|
||||||
|
&& cancelReply(lastKeyboardUsed)
|
||||||
|
&& !action.clearDraft) {
|
||||||
saveCloudDraft();
|
saveCloudDraft();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3963,7 +3965,12 @@ void HistoryWidget::send(Api::SendOptions options) {
|
|||||||
ignoreSlowmodeCountdown)) {
|
ignoreSlowmodeCountdown)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Just a flag not to drop reply info if we're not sending anything.
|
||||||
|
_justMarkingAsRead = !HasSendText(_field)
|
||||||
|
&& message.webPage.url.isEmpty();
|
||||||
session().api().sendMessage(std::move(message));
|
session().api().sendMessage(std::move(message));
|
||||||
|
_justMarkingAsRead = false;
|
||||||
|
|
||||||
clearFieldText();
|
clearFieldText();
|
||||||
if (_preview) {
|
if (_preview) {
|
||||||
|
@@ -812,6 +812,7 @@ private:
|
|||||||
int _itemsRevealHeight = 0;
|
int _itemsRevealHeight = 0;
|
||||||
|
|
||||||
bool _sponsoredMessagesStateKnown = false;
|
bool _sponsoredMessagesStateKnown = false;
|
||||||
|
bool _justMarkingAsRead = false;
|
||||||
|
|
||||||
object_ptr<Ui::PlainShadow> _topShadow;
|
object_ptr<Ui::PlainShadow> _topShadow;
|
||||||
bool _inGrab = false;
|
bool _inGrab = false;
|
||||||
|
Reference in New Issue
Block a user