2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +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

@@ -862,7 +862,7 @@ void MediaView::showPhoto(PhotoData *photo, PeerData *context) {
void MediaView::showDocument(DocumentData *doc, HistoryItem *context) {
_photo = 0;
_history = context ? context->history() : 0;
_history = context ? context->history() : nullptr;
if (_history) {
if (_history->peer->migrateFrom()) {
_migrated = App::history(_history->peer->migrateFrom()->id);
@@ -910,7 +910,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) {
_zoom = 0;
_caption = Text();
if (HistoryMessage *itemMsg = item ? item->toHistoryMessage() : 0) {
if (HistoryMessage *itemMsg = item ? item->toHistoryMessage() : nullptr) {
if (HistoryPhoto *photoMsg = dynamic_cast<HistoryPhoto*>(itemMsg->getMedia())) {
_caption.setText(st::mvCaptionFont, photoMsg->getCaption(), (item->author()->isUser() && item->author()->asUser()->botInfo) ? _captionBotOptions : _captionTextOptions);
}
@@ -958,7 +958,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty
stopGif();
}
_doc = doc;
_photo = 0;
_photo = nullptr;
_current = QPixmap();
@@ -1087,7 +1087,11 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty
}
_x = (width() - _w) / 2;
_y = (height() - _h) / 2;
_from = item->authorOriginal();
if (_msgid && item) {
_from = item->authorOriginal();
} else {
_from = _user;
}
_full = 1;
updateControls();
if (isHidden()) {