2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Inline bot results preview: photo, audio, file, voice. Beta 9040126.

This commit is contained in:
John Preston
2016-04-10 22:18:26 +04:00
parent fe59c815b2
commit dd1d04e9b0
32 changed files with 597 additions and 258 deletions

View File

@@ -19,15 +19,16 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "mainwidget.h"
#include "ui/style.h"
#include "lang.h"
#include "boxes/addcontactbox.h"
#include "fileuploader.h"
#include "application.h"
#include "window.h"
#include "settingswidget.h"
#include "mainwidget.h"
#include "inline_bots/inline_bot_layout_item.h"
#include "boxes/confirmbox.h"
#include "boxes/stickersetbox.h"
#include "boxes/contactsbox.h"
@@ -838,6 +839,10 @@ void MainWidget::notify_historyItemLayoutChanged(const HistoryItem *item) {
if (overview) overview->notify_historyItemLayoutChanged(item);
}
void MainWidget::notify_inlineItemLayoutChanged(const InlineBots::Layout::ItemBase *layout) {
history.notify_inlineItemLayoutChanged(layout);
}
void MainWidget::notify_handlePendingHistoryUpdate() {
history.notify_handlePendingHistoryUpdate();
}
@@ -1854,9 +1859,14 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) {
}
}
if (HistoryItem *item = App::histItemById(audioId.msgId)) {
if (HistoryItem *item = App::histItemById(audioId.contextId)) {
Ui::repaintHistoryItem(item);
}
if (auto items = InlineBots::Layout::documentItems()) {
for (auto item : items->value(audioId.audio)) {
Ui::repaintInlineItem(item);
}
}
}
void MainWidget::documentPlayProgress(const SongMsgId &songId) {
@@ -1889,9 +1899,14 @@ void MainWidget::documentPlayProgress(const SongMsgId &songId) {
}
}
if (HistoryItem *item = App::histItemById(songId.msgId)) {
if (HistoryItem *item = App::histItemById(songId.contextId)) {
Ui::repaintHistoryItem(item);
}
if (auto items = InlineBots::Layout::documentItems()) {
for (auto item : items->value(songId.song)) {
Ui::repaintInlineItem(item);
}
}
}
void MainWidget::hidePlayer() {