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

Ignore only empty drafts while sending with clear_draft (#5424)

This commit is contained in:
udf
2018-12-26 08:52:48 +02:00
committed by John Preston
parent 71cf4a4885
commit 0b87db8b45
4 changed files with 10 additions and 7 deletions

View File

@@ -53,10 +53,10 @@ void applyPeerCloudDraft(PeerId peerId, const MTPDdraftMessage &draft) {
? TextUtilities::EntitiesFromMTP(draft.ventities.v)
: EntitiesInText())
};
if (history->skipCloudDraft(textWithTags.text, draft.vdate.v)) {
auto replyTo = draft.has_reply_to_msg_id() ? draft.vreply_to_msg_id.v : MsgId(0);
if (history->skipCloudDraft(textWithTags.text, replyTo, draft.vdate.v)) {
return;
}
auto replyTo = draft.has_reply_to_msg_id() ? draft.vreply_to_msg_id.v : MsgId(0);
auto cloudDraft = std::make_unique<Draft>(
textWithTags,
replyTo,
@@ -80,7 +80,7 @@ void applyPeerCloudDraft(PeerId peerId, const MTPDdraftMessage &draft) {
void clearPeerCloudDraft(PeerId peerId, TimeId date) {
const auto history = App::history(peerId);
if (history->skipCloudDraft(QString(), date)) {
if (history->skipCloudDraft(QString(), MsgId(0), date)) {
return;
}