mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-21 17:37:48 +00:00
Compare commits
8 Commits
5e670ca217
...
95a4d62b54
Author | SHA1 | Date | |
---|---|---|---|
|
95a4d62b54 | ||
|
12bbe26692 | ||
|
127964a3f2 | ||
|
16de9313b0 | ||
|
94aa9d390b | ||
|
3a53074483 | ||
|
dd17f94d9a | ||
|
f1646e0b0f |
@ -6,7 +6,7 @@ if (POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW)
|
||||
endif()
|
||||
|
||||
project(TelegramBotApi VERSION 7.7 LANGUAGES CXX)
|
||||
project(TelegramBotApi VERSION 7.8 LANGUAGES CXX)
|
||||
|
||||
if (POLICY CMP0069)
|
||||
option(TELEGRAM_BOT_API_ENABLE_LTO "Use \"ON\" to enable Link Time Optimization.")
|
||||
|
12
build.html
12
build.html
@ -2,7 +2,8 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Telegram Bot API server build instructions</title>
|
||||
<title>Telegram Bot API server build instructions</title>
|
||||
<link rel="icon" type="image/svg+xml" sizes="16x16|any" href="https://telegram.org/img/t_logo.svg"/>
|
||||
<style>
|
||||
:root {
|
||||
--background: #fafafa;
|
||||
@ -534,29 +535,26 @@ function onOptionsChanged() {
|
||||
break;
|
||||
case 'CentOS 7':
|
||||
commands.push(sudo + 'yum update -y');
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
|
||||
commands.push(sudo + 'yum install -y centos-release-scl-rh epel-release');
|
||||
commands.push(sudo + 'yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++');
|
||||
cmake = 'cmake3';
|
||||
packages += ' gperf ' + cmake;
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel gperf ' + cmake;
|
||||
commands.push(sudo + 'yum install -y ' + packages);
|
||||
break;
|
||||
case 'CentOS 8':
|
||||
case 'CentOS Stream 9':
|
||||
commands.push(sudo + 'dnf update -y');
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
|
||||
if (linux_distro === 'CentOS 8') {
|
||||
commands.push(sudo + 'dnf --enablerepo=powertools install gperf');
|
||||
} else {
|
||||
commands.push(sudo + 'dnf --enablerepo=crb install gperf');
|
||||
}
|
||||
packages += ' ' + cmake;
|
||||
var packages = 'gcc-c++ make git zlib-devel openssl-devel cmake';
|
||||
commands.push(sudo + 'dnf install -y ' + packages);
|
||||
break;
|
||||
case 'Fedora 21+':
|
||||
commands.push(sudo + 'dnf update -y');
|
||||
var packages = 'gperf gcc-c++ make git zlib-devel openssl-devel';
|
||||
packages += ' ' + cmake;
|
||||
var packages = 'gperf gcc-c++ make git zlib-devel openssl-devel cmake';
|
||||
commands.push(sudo + 'dnf install -y ' + packages);
|
||||
break;
|
||||
case 'Debian 8/9':
|
||||
|
2
td
2
td
@ -1 +1 @@
|
||||
Subproject commit cb164927417f22811c74cd8678ed4a5ab7cb80ba
|
||||
Subproject commit 1fa2a372a88c26369dcac2ce476166531df74a77
|
@ -420,6 +420,7 @@ class Client::JsonUser final : public td::Jsonable {
|
||||
object("can_read_all_group_messages", td::JsonBool(user_info->can_read_all_group_messages));
|
||||
object("supports_inline_queries", td::JsonBool(user_info->is_inline_bot));
|
||||
object("can_connect_to_business", td::JsonBool(user_info->can_connect_to_business));
|
||||
object("has_main_web_app", td::JsonBool(user_info->has_main_web_app));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3285,6 +3286,8 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
|
||||
object("refunded_payment", JsonRefundedPayment(content));
|
||||
break;
|
||||
}
|
||||
case td_api::messageGiftedStars::ID:
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
@ -4085,7 +4088,7 @@ class Client::JsonStarTransactionPartner final : public td::Jsonable {
|
||||
case td_api::starTransactionPartnerBot::ID: {
|
||||
auto source_user = static_cast<const td_api::starTransactionPartnerBot *>(source_);
|
||||
object("type", "user");
|
||||
object("user", JsonUser(source_user->bot_user_id_, client_));
|
||||
object("user", JsonUser(source_user->user_id_, client_));
|
||||
if (!source_user->invoice_payload_.empty()) {
|
||||
if (!td::check_utf8(source_user->invoice_payload_)) {
|
||||
LOG(WARNING) << "Receive non-UTF-8 invoice payload";
|
||||
@ -4102,6 +4105,7 @@ class Client::JsonStarTransactionPartner final : public td::Jsonable {
|
||||
case td_api::starTransactionPartnerTelegram::ID:
|
||||
case td_api::starTransactionPartnerAppStore::ID:
|
||||
case td_api::starTransactionPartnerGooglePlay::ID:
|
||||
case td_api::starTransactionPartnerUser::ID:
|
||||
case td_api::starTransactionPartnerChannel::ID:
|
||||
LOG(ERROR) << "Receive " << to_string(*source_);
|
||||
object("type", "other");
|
||||
@ -11299,10 +11303,21 @@ td::Status Client::process_set_chat_description_query(PromisedQueryPtr &query) {
|
||||
}
|
||||
|
||||
td::Status Client::process_pin_chat_message_query(PromisedQueryPtr &query) {
|
||||
auto business_connection_id = query->arg("business_connection_id");
|
||||
auto chat_id = query->arg("chat_id");
|
||||
auto message_id = get_message_id(query.get());
|
||||
auto disable_notification = to_bool(query->arg("disable_notification"));
|
||||
|
||||
if (!business_connection_id.empty()) {
|
||||
check_business_connection_chat_id(
|
||||
business_connection_id.str(), chat_id.str(), std::move(query),
|
||||
[this, message_id](const BusinessConnection *business_connection, int64 chat_id, PromisedQueryPtr query) {
|
||||
send_request(
|
||||
make_object<td_api::setBusinessMessageIsPinned>(business_connection->id_, chat_id, message_id, true),
|
||||
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
|
||||
});
|
||||
return td::Status::OK();
|
||||
}
|
||||
check_message(chat_id, message_id, false, AccessRights::Write, "message to pin", std::move(query),
|
||||
[this, disable_notification](int64 chat_id, int64 message_id, PromisedQueryPtr query) {
|
||||
send_request(make_object<td_api::pinChatMessage>(chat_id, message_id, disable_notification, false),
|
||||
@ -11312,9 +11327,21 @@ td::Status Client::process_pin_chat_message_query(PromisedQueryPtr &query) {
|
||||
}
|
||||
|
||||
td::Status Client::process_unpin_chat_message_query(PromisedQueryPtr &query) {
|
||||
auto business_connection_id = query->arg("business_connection_id");
|
||||
auto chat_id = query->arg("chat_id");
|
||||
auto message_id = get_message_id(query.get());
|
||||
|
||||
if (!business_connection_id.empty()) {
|
||||
check_business_connection_chat_id(
|
||||
business_connection_id.str(), chat_id.str(), std::move(query),
|
||||
[this, message_id](const BusinessConnection *business_connection, int64 chat_id, PromisedQueryPtr query) {
|
||||
send_request(
|
||||
make_object<td_api::setBusinessMessageIsPinned>(business_connection->id_, chat_id, message_id, false),
|
||||
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
|
||||
});
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
if (message_id == 0) {
|
||||
check_chat(chat_id, AccessRights::Write, std::move(query), [this](int64 chat_id, PromisedQueryPtr query) {
|
||||
send_request(make_object<td_api::getChatPinnedMessage>(chat_id),
|
||||
@ -12832,6 +12859,7 @@ void Client::add_user(UserInfo *user_info, object_ptr<td_api::user> &&user) {
|
||||
user_info->can_read_all_group_messages = bot->can_read_all_group_messages_;
|
||||
user_info->is_inline_bot = bot->is_inline_;
|
||||
user_info->can_connect_to_business = bot->can_connect_to_business_;
|
||||
user_info->has_main_web_app = bot->has_main_web_app_;
|
||||
break;
|
||||
}
|
||||
case td_api::userTypeDeleted::ID:
|
||||
@ -13778,6 +13806,8 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
|
||||
return true;
|
||||
case td_api::messagePremiumGiftCode::ID:
|
||||
return true;
|
||||
case td_api::messageGiftedStars::ID:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -841,9 +841,10 @@ class Client final : public WebhookActor::Callback {
|
||||
bool can_join_groups = false;
|
||||
bool can_read_all_group_messages = false;
|
||||
bool can_connect_to_business = false;
|
||||
bool is_inline_bot = false;
|
||||
bool has_main_web_app = false;
|
||||
bool has_private_forwards = false;
|
||||
bool has_restricted_voice_and_video_messages = false;
|
||||
bool is_inline_bot = false;
|
||||
bool is_premium = false;
|
||||
bool added_to_attachment_menu = false;
|
||||
};
|
||||
|
@ -165,7 +165,7 @@ int main(int argc, char *argv[]) {
|
||||
auto start_time = td::Time::now();
|
||||
auto shared_data = std::make_shared<SharedData>();
|
||||
auto parameters = std::make_unique<ClientParameters>();
|
||||
parameters->version_ = "7.7";
|
||||
parameters->version_ = "7.8";
|
||||
parameters->shared_data_ = shared_data;
|
||||
parameters->start_time_ = start_time;
|
||||
auto net_query_stats = td::create_net_query_stats();
|
||||
|
Loading…
x
Reference in New Issue
Block a user