2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

checking inline bot query on text change, not on cursor position change

This commit is contained in:
John Preston
2016-01-02 09:28:11 +08:00
parent d8b1df875e
commit 6fe380ff9f
5 changed files with 72 additions and 51 deletions

View File

@@ -1364,7 +1364,11 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) {
}
} else if (location.accessEnable()) {
if ((App::hoveredLinkItem() || App::contextItem()) && (data->isAnimation() || QImageReader(location.name()).canRead())) {
App::wnd()->showDocument(data, item);
if (action == ActionOnLoadPlayInline) {
item->getMedia()->playInline(item);
} else {
App::wnd()->showDocument(data, item);
}
} else {
psOpenFile(location.name());
}
@@ -1634,7 +1638,11 @@ void DocumentData::performActionOnLoad() {
} else if (_actionOnLoad == ActionOnLoadOpen || _actionOnLoad == ActionOnLoadPlayInline) {
if (loc.accessEnable()) {
if (showImage && QImageReader(loc.name()).canRead()) {
App::wnd()->showDocument(this, item);
if (_actionOnLoad == ActionOnLoadPlayInline) {
item->getMedia()->playInline(item);
} else {
App::wnd()->showDocument(this, item);
}
} else {
psOpenFile(already);
}