Apply message auto-delete time from chat creation message.
This commit is contained in:
parent
4d51b2c875
commit
faee94b680
@ -32340,18 +32340,30 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq
|
|||||||
register_message_reply(dialog_id, m);
|
register_message_reply(dialog_id, m);
|
||||||
|
|
||||||
if (*need_update && m->message_id.is_server()) {
|
if (*need_update && m->message_id.is_server()) {
|
||||||
if (message_content_type == MessageContentType::PinMessage) {
|
switch (message_content_type) {
|
||||||
auto pinned_message_id = get_message_content_pinned_message_id(m->content.get());
|
case MessageContentType::PinMessage: {
|
||||||
if (d->is_last_pinned_message_id_inited && pinned_message_id > d->last_pinned_message_id) {
|
auto pinned_message_id = get_message_content_pinned_message_id(m->content.get());
|
||||||
set_dialog_last_pinned_message_id(d, pinned_message_id);
|
if (d->is_last_pinned_message_id_inited && pinned_message_id > d->last_pinned_message_id) {
|
||||||
|
set_dialog_last_pinned_message_id(d, pinned_message_id);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
case MessageContentType::SetBackground:
|
||||||
if (message_content_type == MessageContentType::SetBackground) {
|
set_dialog_background(d, get_message_content_my_background_info(
|
||||||
set_dialog_background(d, get_message_content_my_background_info(
|
m->content.get(), m->is_outgoing || dialog_id.get_type() != DialogType::User));
|
||||||
m->content.get(), m->is_outgoing || dialog_id.get_type() != DialogType::User));
|
break;
|
||||||
}
|
case 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()));
|
break;
|
||||||
|
case MessageContentType::ChatCreate:
|
||||||
|
case MessageContentType::ChannelCreate:
|
||||||
|
if (m->ttl_period > 0) {
|
||||||
|
set_dialog_message_ttl(d, MessageTtl(m->ttl_period));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// nothing to do
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user