mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Support custom channel backgrounds display.
This commit is contained in:
parent
ac744b957a
commit
b6c679449e
2 changed files with 12 additions and 1 deletions
|
@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_histories.h"
|
||||
#include "data/data_group_call.h"
|
||||
#include "data/data_message_reactions.h"
|
||||
#include "data/data_wall_paper.h"
|
||||
#include "data/notify/data_notify_settings.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/session/send_as_peers.h"
|
||||
|
@ -1142,6 +1143,13 @@ void ApplyChannelUpdate(
|
|||
session->sendAsPeers().setChosen(channel, PeerId());
|
||||
}
|
||||
|
||||
if (const auto paper = update.vwallpaper()) {
|
||||
channel->setWallPaper(
|
||||
Data::WallPaper::Create(&channel->session(), *paper));
|
||||
} else {
|
||||
channel->setWallPaper({});
|
||||
}
|
||||
|
||||
// For clearUpTill() call.
|
||||
channel->owner().sendHistoryChangeNotifications();
|
||||
}
|
||||
|
|
|
@ -509,8 +509,11 @@ rpl::producer<QString> ThemeDocumentBox::button() {
|
|||
}
|
||||
|
||||
ClickHandlerPtr ThemeDocumentBox::createViewLink() {
|
||||
const auto out = _parent->data()->out();
|
||||
const auto to = _parent->history()->peer;
|
||||
if (to->isChannel()) {
|
||||
return nullptr;
|
||||
}
|
||||
const auto out = _parent->data()->out();
|
||||
const auto media = _parent->data()->media();
|
||||
const auto weak = base::make_weak(_parent);
|
||||
const auto paper = media ? media->paper() : nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue