2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added a handler for "MESSAGE_EMPTY" error to delete a local message.

- Added a determination of the zero-width-space as the space.
 - Fixes #3145.
This commit is contained in:
23rd
2019-03-09 17:56:11 +03:00
committed by John Preston
parent e174025a92
commit bfc9e43eb4
2 changed files with 6 additions and 2 deletions

View File

@@ -4628,7 +4628,11 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
applyUpdates(result, randomId);
history->clearSentDraftText(QString());
}).fail([=](const RPCError &error) {
sendMessageFail(error);
if (error.type() == qstr("MESSAGE_EMPTY")) {
lastMessage->destroy();
} else {
sendMessageFail(error);
}
history->clearSentDraftText(QString());
}).afterRequest(history->sendRequestId
).send();