Skip to content

Commit

Permalink
Fix link in sponsoredMessage.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 27, 2021
1 parent 25baeda commit e79ec94
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions td/telegram/SponsoredMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
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());
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;
}
default:
break;
}
Expand Down

0 comments on commit e79ec94

Please sign in to comment.