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

Better channel log entry layout inside messages.

Also move HistoryService class to a separate module.
This commit is contained in:
John Preston
2017-06-22 18:11:41 +03:00
parent 0a39e7e2b1
commit cedf8a65e7
28 changed files with 1134 additions and 1012 deletions

View File

@@ -32,6 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_mediaview.h"
#include "styles/style_history.h"
#include "media/media_audio.h"
#include "history/history_message.h"
#include "history/history_media_types.h"
#include "window/themes/window_theme_preview.h"
#include "base/task_queue.h"
@@ -1182,8 +1183,8 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) {
_zoom = 0;
_caption = Text();
if (HistoryMessage *itemMsg = item ? item->toHistoryMessage() : nullptr) {
if (HistoryPhoto *photoMsg = dynamic_cast<HistoryPhoto*>(itemMsg->getMedia())) {
if (auto itemMsg = item ? item->toHistoryMessage() : nullptr) {
if (auto photoMsg = dynamic_cast<HistoryPhoto*>(itemMsg->getMedia())) {
_caption.setMarkedText(st::mediaviewCaptionStyle, photoMsg->getCaption(), (item->author()->isUser() && item->author()->asUser()->botInfo) ? _captionBotOptions : _captionTextOptions);
}
}