Fix link in sponsoredMessage.

This commit is contained in:
levlam 2021-11-27 13:36:17 +03:00
parent 25baedaa34
commit e79ec9469b

View File

@ -168,13 +168,14 @@ td_api::object_ptr<td_api::sponsoredMessage> SponsoredMessageManager::get_sponso
link = td_api::make_object<td_api::internalLinkTypeBotStart>(bot_username, sponsored_message.start_param);
break;
}
case DialogType::Channel: {
case DialogType::Channel:
if (sponsored_message.server_message_id.is_valid()) {
auto channel_id = sponsored_message.sponsor_dialog_id.get_channel_id();
auto t_me = G()->shared_config().get_option_string("t_me_url", "https://t.me/");
link = td_api::make_object<td_api::internalLinkTypeMessage>(
PSTRING() << t_me << "/c" << channel_id.get() << '/' << sponsored_message.server_message_id.get());
break;
PSTRING() << t_me << "c/" << channel_id.get() << '/' << sponsored_message.server_message_id.get());
}
break;
default:
break;
}