mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 16:05:57 +00:00
Improve editing messages with link previews.
Now preview state can be one of (allowed, cancelled, empty-in-edit). In case of editing a message without preview we set the state to empty-in-edit and it changes to allowed if the links in the message are changed somehow. That way we don't need to cancel the preview when editing a message with a cancelled preview and at the same time adding a link to a message that had no preview in the first place will add a preview.
This commit is contained in:
@@ -501,6 +501,11 @@ MessageLinksParser::MessageLinksParser(not_null<Ui::InputField*> field)
|
||||
_field->installEventFilter(this);
|
||||
}
|
||||
|
||||
void MessageLinksParser::parseNow() {
|
||||
_timer.cancel();
|
||||
parse();
|
||||
}
|
||||
|
||||
bool MessageLinksParser::eventFilter(QObject *object, QEvent *event) {
|
||||
if (object == _field) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
|
Reference in New Issue
Block a user