mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-29 08:47:52 +00:00
Merge tag 'v6.7.8' into dev
# Conflicts: # .github/workflows/mac_packaged.yml # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/api/api_chat_invite.h # Telegram/SourceFiles/boxes/language_box.cpp # Telegram/SourceFiles/boxes/send_files_box.h # Telegram/SourceFiles/boxes/sticker_set_box.cpp # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/data/data_types.h # Telegram/SourceFiles/history/history_item.cpp # Telegram/SourceFiles/history/history_widget.cpp # Telegram/SourceFiles/history/view/history_view_chat_section.cpp # Telegram/SourceFiles/history/view/history_view_message.cpp # Telegram/SourceFiles/history/view/history_view_translate_bar.cpp # Telegram/SourceFiles/history/view/history_view_translate_tracker.cpp # Telegram/SourceFiles/platform/mac/main_window_mac.mm # Telegram/SourceFiles/settings/sections/settings_main.cpp # Telegram/lib_ui # snap/snapcraft.yaml
This commit is contained in:
@@ -30,6 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "history/history.h"
|
||||
#include "history/history_item.h"
|
||||
#include "history/history_item_components.h"
|
||||
#include "history/history_streamed_drafts.h"
|
||||
#include "history/view/media/history_view_media.h"
|
||||
#include "history/view/history_view_element.h"
|
||||
#include "inline_bots/inline_bot_layout_item.h"
|
||||
@@ -2109,6 +2110,11 @@ void Session::requestItemTextRefresh(not_null<HistoryItem*> item) {
|
||||
view->itemTextUpdated();
|
||||
});
|
||||
requestItemResize(item);
|
||||
if (item->textAppearing()) {
|
||||
enumerateItemViews(item, [&](not_null<ViewElement*> view) {
|
||||
view->skipInactiveTextAppearing();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (const auto group = groups().find(item)) {
|
||||
call(group->items.front());
|
||||
@@ -2117,14 +2123,6 @@ void Session::requestItemTextRefresh(not_null<HistoryItem*> item) {
|
||||
}
|
||||
}
|
||||
|
||||
void Session::requestItemTextRefreshStreaming(
|
||||
not_null<HistoryItem*> item) {
|
||||
enumerateItemViews(item, [&](not_null<ViewElement*> view) {
|
||||
view->itemTextUpdatedStreaming();
|
||||
});
|
||||
requestItemResize(item);
|
||||
}
|
||||
|
||||
void Session::registerRestricted(
|
||||
not_null<const HistoryItem*> item,
|
||||
const QString &reason) {
|
||||
@@ -3179,6 +3177,20 @@ HistoryItem *Session::addNewMessage(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (data.type() == mtpc_message) {
|
||||
if (const auto h = historyLoaded(peerId)) {
|
||||
if (const auto streamed = h->streamedDraftsIfExists()) {
|
||||
if (const auto adopted = streamed->adoptIncoming(
|
||||
data.c_message())) {
|
||||
if (type == NewMessageType::Unread) {
|
||||
CheckForSwitchInlineButton(adopted);
|
||||
}
|
||||
return adopted;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto result = history(peerId)->addNewMessage(
|
||||
id,
|
||||
data,
|
||||
@@ -4206,6 +4218,21 @@ void Session::webpageApplyFields(
|
||||
auto iv = (data.vcached_page() && !IgnoreIv(type))
|
||||
? std::make_unique<Iv::Data>(data, *data.vcached_page())
|
||||
: nullptr;
|
||||
const auto resolvedPhoto = story
|
||||
? story->photo()
|
||||
: photo
|
||||
? processPhoto(*photo).get()
|
||||
: nullptr;
|
||||
const auto resolvedDocument = story
|
||||
? story->document()
|
||||
: document
|
||||
? processDocument(*document).get()
|
||||
: lookupThemeDocument();
|
||||
const auto photoIsVideoCover = data.is_video_cover_photo()
|
||||
|| (resolvedDocument
|
||||
&& resolvedPhoto
|
||||
&& resolvedDocument->isVideoFile()
|
||||
&& !resolvedDocument->hasThumbnail());
|
||||
webpageApplyFields(
|
||||
page,
|
||||
type,
|
||||
@@ -4215,16 +4242,8 @@ void Session::webpageApplyFields(
|
||||
qs(data.vtitle().value_or_empty()),
|
||||
(story ? story->caption() : description),
|
||||
storyId,
|
||||
(story
|
||||
? story->photo()
|
||||
: photo
|
||||
? processPhoto(*photo).get()
|
||||
: nullptr),
|
||||
(story
|
||||
? story->document()
|
||||
: document
|
||||
? processDocument(*document).get()
|
||||
: lookupThemeDocument()),
|
||||
resolvedPhoto,
|
||||
resolvedDocument,
|
||||
WebPageCollage(this, data),
|
||||
std::move(iv),
|
||||
lookupStickerSet(),
|
||||
@@ -4233,7 +4252,7 @@ void Session::webpageApplyFields(
|
||||
data.vduration().value_or_empty(),
|
||||
qs(data.vauthor().value_or_empty()),
|
||||
data.is_has_large_media(),
|
||||
data.is_video_cover_photo(),
|
||||
photoIsVideoCover,
|
||||
pendingTill);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user