mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-01 03:50:43 +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:
parent
e174025a92
commit
bfc9e43eb4
@ -4628,7 +4628,11 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
|
|||||||
applyUpdates(result, randomId);
|
applyUpdates(result, randomId);
|
||||||
history->clearSentDraftText(QString());
|
history->clearSentDraftText(QString());
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
sendMessageFail(error);
|
if (error.type() == qstr("MESSAGE_EMPTY")) {
|
||||||
|
lastMessage->destroy();
|
||||||
|
} else {
|
||||||
|
sendMessageFail(error);
|
||||||
|
}
|
||||||
history->clearSentDraftText(QString());
|
history->clearSentDraftText(QString());
|
||||||
}).afterRequest(history->sendRequestId
|
}).afterRequest(history->sendRequestId
|
||||||
).send();
|
).send();
|
||||||
|
@ -261,7 +261,7 @@ QString textcmdStopSemibold();
|
|||||||
const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink = true);
|
const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink = true);
|
||||||
|
|
||||||
inline bool chIsSpace(QChar ch, bool rich = false) {
|
inline bool chIsSpace(QChar ch, bool rich = false) {
|
||||||
return ch.isSpace() || (ch < 32 && !(rich && ch == TextCommand)) || (ch == QChar::ParagraphSeparator) || (ch == QChar::LineSeparator) || (ch == QChar::ObjectReplacementCharacter) || (ch == QChar::CarriageReturn) || (ch == QChar::Tabulation);
|
return ch.isSpace() || (ch < 32 && !(rich && ch == TextCommand)) || (ch == QChar::ParagraphSeparator) || (ch == QChar::LineSeparator) || (ch == QChar::ObjectReplacementCharacter) || (ch == QChar::CarriageReturn) || (ch == QChar::Tabulation) || (ch == QChar(8203)/*Zero width space.*/);
|
||||||
}
|
}
|
||||||
inline bool chIsDiac(QChar ch) { // diac and variation selectors
|
inline bool chIsDiac(QChar ch) { // diac and variation selectors
|
||||||
return (ch.category() == QChar::Mark_NonSpacing) || (ch == 1652) || (ch >= 64606 && ch <= 64611);
|
return (ch.category() == QChar::Mark_NonSpacing) || (ch == 1652) || (ch >= 64606 && ch <= 64611);
|
||||||
|
Loading…
Reference in New Issue
Block a user