Apply chat background set by the other user.
This commit is contained in:
parent
6f3180aeaf
commit
072f811a9c
@ -3623,13 +3623,19 @@ MessageId get_message_content_pinned_message_id(const MessageContent *content) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BackgroundInfo get_message_content_background_info(const MessageContent *content) {
|
BackgroundInfo get_message_content_my_background_info(const MessageContent *content, bool is_outgoing) {
|
||||||
switch (content->get_type()) {
|
switch (content->get_type()) {
|
||||||
case MessageContentType::SetBackground:
|
case MessageContentType::SetBackground: {
|
||||||
return static_cast<const MessageSetBackground *>(content)->background_info;
|
const auto *set_background = static_cast<const MessageSetBackground *>(content);
|
||||||
default:
|
if (is_outgoing || set_background->for_both) {
|
||||||
return BackgroundInfo();
|
return set_background->background_info;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return BackgroundInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
string get_message_content_theme_name(const MessageContent *content) {
|
string get_message_content_theme_name(const MessageContent *content) {
|
||||||
|
@ -149,7 +149,7 @@ StickerType get_message_content_sticker_type(const Td *td, const MessageContent
|
|||||||
|
|
||||||
MessageId get_message_content_pinned_message_id(const MessageContent *content);
|
MessageId get_message_content_pinned_message_id(const MessageContent *content);
|
||||||
|
|
||||||
BackgroundInfo get_message_content_background_info(const MessageContent *content);
|
BackgroundInfo get_message_content_my_background_info(const MessageContent *content, bool is_outgoing);
|
||||||
|
|
||||||
string get_message_content_theme_name(const MessageContent *content);
|
string get_message_content_theme_name(const MessageContent *content);
|
||||||
|
|
||||||
|
@ -35421,8 +35421,8 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
|
|||||||
set_dialog_last_pinned_message_id(d, pinned_message_id);
|
set_dialog_last_pinned_message_id(d, pinned_message_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message_content_type == MessageContentType::SetBackground && m->is_outgoing) {
|
if (message_content_type == MessageContentType::SetBackground) {
|
||||||
set_dialog_background(d, get_message_content_background_info(m->content.get()));
|
set_dialog_background(d, get_message_content_my_background_info(m->content.get(), m->is_outgoing));
|
||||||
}
|
}
|
||||||
if (message_content_type == MessageContentType::ChatSetTheme) {
|
if (message_content_type == MessageContentType::ChatSetTheme) {
|
||||||
set_dialog_theme_name(d, get_message_content_theme_name(m->content.get()));
|
set_dialog_theme_name(d, get_message_content_theme_name(m->content.get()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user