Compare commits

...

171 Commits

Author SHA1 Message Date
giuseppeM99
35fc3cd1fa
Merge pull request #91 from davidgfnet/master
Fix docs generation
2024-10-06 21:04:28 +02:00
David Guillen Fandos
04ea059120 Fix docs generation 2024-10-06 20:59:17 +02:00
Giuseppe Marino
d2f6201abc
Update workflow actions 2024-10-01 01:14:52 +02:00
giuseppeM99
8ba69b0857
Merge pull request #89 from davidgfnet/master
Update to version 7.10
2024-10-01 00:59:37 +02:00
David Guillen Fandos
7d69086f55 Merge update to version 7.10 2024-09-09 00:34:57 +02:00
David Guillen Fandos
affc48106c Merge update to version 7.7 2024-09-09 00:20:53 +02:00
David Guillen Fandos
dc9a4ba88b Merge update to version 7.3 2024-09-07 20:05:32 +02:00
David Guillen Fandos
345fe067e4 Merge version 7.1 2024-09-07 14:01:28 +02:00
levlam
a186a9ae82 Update version to 7.10. 2024-09-06 16:22:58 +03:00
levlam
4acd7d28e6 Add GiveawayCompleted.is_star_giveaway. 2024-08-30 11:45:49 +03:00
levlam
c96ab13288 Add ChatBoostSourceGiveaway.prize_star_count. 2024-08-30 11:44:17 +03:00
levlam
cb41fe9930 Add "purchased_paid_media" update. 2024-08-28 13:13:51 +03:00
levlam
c08e6b3b84 Add GiveawayWinners.prize_star_count. 2024-08-28 12:32:03 +03:00
levlam
1548e96656 Add Giveaway.prize_star_count. 2024-08-28 12:29:44 +03:00
levlam
7422214945 Add GiveawayCreated.prize_star_count. 2024-08-28 12:27:23 +03:00
levlam
3fdee61a88 Add sendPaidMedia.payload. 2024-08-28 12:13:10 +03:00
levlam
f8c757d07d Add TransactionPartnerUser.paid_media_payload. 2024-08-28 12:10:37 +03:00
levlam
dfe0dc9881 Add Client::on_get_sticker_set_name overload. 2024-08-28 12:01:43 +03:00
levlam
c571a9ee5b Use td_api::getStickerSetName instead of td_api::getStickerSet. 2024-08-28 11:54:13 +03:00
levlam
240eb7b4a9 Update TDLib to 1.8.36. 2024-08-27 17:42:44 +03:00
levlam
6e5d607b90 Add and use Client::is_special_error_code. 2024-08-27 15:55:54 +03:00
levlam
06e2e31aea Update version to 7.9. 2024-08-14 05:16:39 +03:00
levlam
961a19e1a0 Add method editChatSubscriptionInviteLink. 2024-08-14 00:29:32 +03:00
levlam
76e5ed31c0 Add method createChatSubscriptionInviteLink. 2024-08-14 00:26:20 +03:00
levlam
6478c25096 Support botTransactionPurposePaidMedia. 2024-08-13 16:00:42 +03:00
levlam
af5f55b206 Add subscription information to ChatInviteLink. 2024-08-13 15:46:37 +03:00
levlam
e171396b8a Support chatMemberStatusMember.member_until_date. 2024-08-13 15:28:48 +03:00
levlam
3c4656b539 Support paid reactions. 2024-08-13 15:24:19 +03:00
levlam
ffe39d4114 Update TDLib to 1.8.35. 2024-08-13 14:51:15 +03:00
levlam
12bbe26692 Update version to 7.8. 2024-07-30 16:21:23 +03:00
levlam
127964a3f2 Add User.has_main_web_app. 2024-07-30 13:43:00 +03:00
levlam
16de9313b0 Support unpinChatMessage for business messages. 2024-07-30 13:10:46 +03:00
levlam
94aa9d390b Support pinChatMessage for business messages. 2024-07-30 13:05:42 +03:00
levlam
3a53074483 Update TDLib to 1.8.34. 2024-07-30 12:28:40 +03:00
levlam
dd17f94d9a Simplify packages list in build instructions generator. 2024-07-18 17:21:56 +03:00
Alexander
6ba3d865ac
Build instructions updated (#615)
* Build instructions updated

- Fixed package manager in CentOS
- Added instructions for CentOS 9
- Added instructions for Fedora 37
2024-07-15 21:49:30 +03:00
levlam
9112a6b535 Update version to 7.7. 2024-07-07 00:17:06 +03:00
levlam
e87d1ef00e Add Message.refunded_payment. 2024-07-07 00:16:25 +03:00
levlam
d4bb6785af Update TDLib to 1.8.33. 2024-07-07 00:12:40 +03:00
levlam
cfa7313aed Update version to 7.6. 2024-07-01 01:32:50 +03:00
levlam
5e11cbe53e Add sendPaidMedia. 2024-06-30 14:16:49 +03:00
levlam
4fe3ba9c99 Add Message.paid_media and ExternalReplyInfo.paid_media. 2024-06-30 14:05:09 +03:00
levlam
3e1fee6d7a Add ChatFullInfo.can_send_paid_media for channels. 2024-06-30 13:33:06 +03:00
levlam
546777ab24 Add invoice_payload to "user" transaction partner. 2024-06-30 13:27:55 +03:00
levlam
76006f4a2e Add "telegram_ads" transaction partner. 2024-06-30 13:26:14 +03:00
levlam
f47e0a9fde Update TDLib to 1.8.32. 2024-06-30 12:43:03 +03:00
levlam
1873bf58f3 Simplify some calls to fail_query_with_error. 2024-06-26 00:46:00 +03:00
levlam
ecfce9042b Update version to 7.5. 2024-06-18 01:01:31 +03:00
levlam
025884aeca Add getStarTransactions. 2024-06-15 00:57:27 +03:00
levlam
a879acc49d Add check_business_connection_chat_id. 2024-06-11 23:12:04 +03:00
levlam
bd31c2a9ce Support stopPoll for business messages. 2024-06-11 23:02:03 +03:00
levlam
86fb9bc8b8 Support editMessageReplyMarkup for business messages. 2024-06-11 22:53:41 +03:00
levlam
f75e2155c1 Support editMessageCaption for business messages. 2024-06-11 22:50:39 +03:00
levlam
6c01c85d27 Support editMessageMedia for business messages. 2024-06-11 22:44:26 +03:00
levlam
c8079841ed Support editMessageLiveLocation for business messages. 2024-06-11 22:41:59 +03:00
levlam
7ee51f8c6d Support editMessageText for business messages. 2024-06-11 22:27:25 +03:00
levlam
e2af6c8e02 Add callback query updates from business messages. 2024-06-11 22:07:13 +03:00
levlam
d982389d77 Update TDLib to 1.8.31. 2024-06-11 21:42:50 +03:00
levlam
2b0bb9207c Split "chat_member" and "chat_join_request" updates by a user. 2024-06-06 13:57:02 +03:00
levlam
221db0fa1f Improve getUpdates warnings. 2024-05-30 19:47:21 +03:00
levlam
a94b95eac5 Update copyright year. 2024-05-30 19:40:54 +03:00
levlam
831968def2 Update version to 7.4. 2024-05-28 00:11:50 +03:00
levlam
486539c514 Add refundStarPayment method. 2024-05-24 15:44:38 +03:00
levlam
325dc5d293 Support expandable_blockquote entities. 2024-05-21 12:39:13 +03:00
levlam
70b9d04b58 Make provider_token optional for invoices in Telegram Stars. 2024-05-20 15:05:46 +03:00
levlam
34a52855ee Allow to change show_caption_above_media when replacing caption of a copied message. 2024-05-20 14:54:53 +03:00
levlam
f32756cd0d Allow to edit show_caption_above_media. 2024-05-20 14:54:17 +03:00
levlam
5f3e2202b7 Allow to send messages with caption above media. 2024-05-20 14:48:41 +03:00
levlam
7d7b4049a4 Allow adding effects to sent messages. 2024-05-20 14:41:19 +03:00
levlam
7eee0eed84 Add message.show_caption_above_media. 2024-05-20 14:27:04 +03:00
levlam
278e1e254a Add Message.effect_id. 2024-05-20 14:20:55 +03:00
levlam
14ea0576cd Update TDLib to 1.8.30. 2024-05-20 14:13:18 +03:00
levlam
5951bfbab8 Port build instructions generator changes. 2024-05-14 17:28:42 +03:00
levlam
f95d406da6 Update version to 7.3. 2024-05-04 02:37:29 +03:00
levlam
681e67c055 Support sending polls with custom emoji. 2024-05-04 01:56:10 +03:00
levlam
1d3a1f2bf1 Support custom emoji entities in incoming polls. 2024-05-04 01:49:17 +03:00
levlam
ff01a73df3 Add live_period parameter to editMessageLiveLocation. 2024-05-04 01:12:16 +03:00
levlam
7febd857d6 Add ChatMemberUpdated.via_join_request. 2024-05-04 00:57:31 +03:00
levlam
9f4e8eb867 Add Chat.max_reaction_count. 2024-05-04 00:31:50 +03:00
levlam
a5a1c509eb Update TDLib to 1.8.29. 2024-05-04 00:21:18 +03:00
levlam
8ced3a1e60 Reget inaccessible users. 2024-05-02 17:10:28 +03:00
levlam
d2ec2fff00 Add Message.chat_background_set. 2024-05-01 20:22:31 +03:00
levlam
b56b61ba0e Update TDLib to 1.8.28. 2024-04-21 22:04:27 +03:00
levlam
6173126371 Update version to 7.2. 2024-03-31 19:26:26 +03:00
levlam
c69178b298 Add Chat.personal_chat. 2024-03-28 19:45:48 +03:00
levlam
5f6e1a262f Add User.can_connect_to_business. 2024-03-28 19:40:12 +03:00
levlam
f706d88055 Add Chat.birthdate. 2024-03-22 15:26:22 +03:00
levlam
f684e4c503 Add replaceStickerInSet. 2024-03-22 15:09:08 +03:00
levlam
e89489b1b2 Support requesting of additional fields by keyboard buttons. 2024-03-22 14:50:01 +03:00
levlam
e491a5a31d Add more fields to ChatShared. 2024-03-22 13:37:31 +03:00
levlam
d442d4b361 Add UsersShared.users. 2024-03-22 13:34:26 +03:00
levlam
e327bbe8fe Add Message.is_from_offline. 2024-03-22 13:03:48 +03:00
levlam
1adfc80566 Resolve business intro sticker set. 2024-03-19 16:31:34 +03:00
levlam
f852504301 Store td_api::businessInfo in UserInfo. 2024-03-19 16:07:43 +03:00
levlam
3d54e3c43b Add Chat.business_intro. 2024-03-19 16:03:04 +03:00
levlam
938847a51e Pass BusinessConnection pointer to check_business_connection callback. 2024-03-18 21:50:53 +03:00
levlam
5ca4a446f0 Add getBusinessConnection method. 2024-03-18 18:31:52 +03:00
levlam
15836d84f4 Add Message.sender_business_bot. 2024-03-18 17:50:16 +03:00
levlam
1a86bb56db Add chat.business_opening_hours field. 2024-03-18 17:04:42 +03:00
levlam
f1c1447185 Add chat.business_location field. 2024-03-18 14:26:39 +03:00
levlam
a872d60362 Add setStickerSetThumbnail.format parameter. 2024-03-18 14:17:05 +03:00
levlam
538fc78fa6 Add "deleted_business_messages" updates. 2024-03-18 13:58:44 +03:00
levlam
5bc5297746 Add Client::get_legacy_input_sticker. 2024-03-18 12:52:17 +03:00
levlam
c783b1c821 Add "business_message" and "edited_business_message" updates. 2024-03-18 12:36:19 +03:00
levlam
b9d4d57678 Support business messages in need_skip_update_message. 2024-03-18 11:54:29 +03:00
levlam
f6497b76c4 Support replies in business messages. 2024-03-18 11:21:43 +03:00
levlam
82134ecc94 Support sending media groups as business. 2024-03-15 15:56:40 +03:00
levlam
2ac6b4bcca Support sending messages to business connection. 2024-03-14 22:51:02 +03:00
levlam
f05754481f Support business_connection_id with sendChatAction. 2024-03-14 20:07:18 +03:00
levlam
a731cb0083 Add Client::init_message. 2024-03-14 16:09:23 +03:00
levlam
a3f62fcdf7 Add cache for business connections. 2024-03-14 15:44:44 +03:00
levlam
393b6c00fb Add "business_connection" updates. 2024-03-14 15:09:47 +03:00
levlam
de02ab0a00 Update TDLib to 1.8.27. 2024-03-14 14:47:41 +03:00
levlam
a19b05e4ff Fix warnings. 2024-03-11 22:28:39 +03:00
levlam
58c2f0165c Update TDLib to 1.8.26. 2024-03-08 14:50:28 +03:00
Andrea Cavalli
6f785fd26b Fix crash 2024-02-16 15:24:05 +01:00
levlam
74f7c3a0cd Update version to 7.1. 2024-02-16 03:36:41 +03:00
levlam
656152f1f1 Add Message.reply_to_story. 2024-02-15 11:20:57 +03:00
levlam
c7adc690e4 Add chat and id fields to the class Story. 2024-02-14 18:43:33 +03:00
levlam
36b97bd5a7 Add Chat.unrestrict_boost_count. 2024-02-14 18:16:48 +03:00
levlam
f9bd4980ee Add Message.sender_boost_count. 2024-02-14 17:53:10 +03:00
levlam
75a2aae6b3 Support service messages about added boosts. 2024-02-14 17:44:52 +03:00
levlam
5da588afbe Don't reopen instance by "close" request. 2024-02-14 17:05:51 +03:00
levlam
d8c8291886 Allow faster reopen for bots that were successfully authorized. 2024-02-14 16:59:22 +03:00
levlam
e7b81da50b Make story management rights non-optional. 2024-02-14 14:06:55 +03:00
levlam
f1b9eb8d4c Update TDLib to 1.8.25. 2024-02-14 14:04:56 +03:00
levlam
4639fbfb64 Update TDLib to 1.8.24. 2024-01-29 02:03:25 +03:00
levlam
4942b4346b Print log before dumping stack trace to avoid log overwriting by other threads. 2024-01-18 14:34:05 +03:00
levlam
fc1de34374 Allow to pass empty ReplyParameters. 2024-01-01 17:47:09 +03:00
levlam
ade0841d41 Update version to 7.0. 2023-12-28 00:42:15 +03:00
levlam
ee59941ca3 Add Message.users_shared field. 2023-12-22 23:32:52 +03:00
levlam
0fbcfa7eba Support request_users.max_quantity. 2023-12-22 23:26:43 +03:00
levlam
047a3e9922 Support channel emoji status. 2023-12-21 22:30:01 +03:00
levlam
0ec870fd77 Add setMessageReaction method. 2023-12-20 17:57:39 +03:00
levlam
56d2dc6392 Add "message_reaction_count" update. 2023-12-20 17:45:26 +03:00
levlam
82e48a0908 Add "message_reaction" updates. 2023-12-20 17:35:18 +03:00
levlam
1320b03bc5 Add Message.giveaway_winners. 2023-12-20 16:44:01 +03:00
levlam
1f512433ef Add "has_public_winners" and "prize_description" giveaway fields. 2023-12-20 16:19:06 +03:00
levlam
fd87df5fed Add fields chat.profile_accent_color_id and chat.profile_background_custom_emoji_id. 2023-12-20 16:09:15 +03:00
levlam
fa0bc023fb Update TDLib to 1.8.23. 2023-12-20 16:05:37 +03:00
levlam
f5f7bbb57f Add Chat.available_reactions. 2023-12-20 15:14:10 +03:00
levlam
57cad9c0a8 Add copyMessages method. 2023-12-12 14:48:35 +03:00
levlam
b039c8e927 Add forwardMessages method. 2023-12-12 14:37:51 +03:00
levlam
1c25870679 Add deleteMessages method. 2023-12-11 20:55:10 +03:00
levlam
83a49569ab Store identifier of inaccessible pinned message. 2023-12-04 15:32:17 +03:00
levlam
6fdb4d2416 Add Message.giveaway_completed. 2023-12-04 15:23:59 +03:00
levlam
9620d43700 Support quote position in reply parameters. 2023-12-04 14:31:45 +03:00
levlam
2c5ff070b3 Add class TextQuote. 2023-12-04 14:18:57 +03:00
levlam
59436578ee Update TDLib to 1.8.22. 2023-12-04 13:42:00 +03:00
levlam
e66ffb1556 Support chat in ReplyParameters. 2023-11-15 16:18:00 +03:00
levlam
1333e3d2ea Support quote in ReplyParameters. 2023-11-14 19:34:38 +03:00
levlam
fcb1814a0c Improve error message. 2023-11-14 19:22:17 +03:00
levlam
9f5b2fa537 Add class ReplyParameters and fields "reply_parameters". 2023-11-14 18:55:55 +03:00
levlam
095511b4eb Add Client::check_reply_parameters. 2023-11-14 18:10:00 +03:00
levlam
76c108bf3c Simplify JsonChat usage. 2023-11-14 13:07:14 +03:00
levlam
096f066024 Add Message.quote and Message.quote_entities. 2023-11-14 13:00:27 +03:00
levlam
52171bd90c Add Message.external_reply. 2023-11-14 12:56:32 +03:00
levlam
c729e35ddb Add Message.forward_origin. 2023-11-13 23:17:15 +03:00
levlam
c44f2c6c3c Store td_api::MessageOrigin in MessageInfo. 2023-11-13 22:41:02 +03:00
levlam
00d351c85c Add message.link_preview_options. 2023-11-13 22:08:07 +03:00
levlam
c39cc1b0ca Allow to specify link preview options for sent text messages. 2023-11-13 21:19:35 +03:00
levlam
f1674d26de Add getUserChatBoosts. 2023-11-13 20:16:11 +03:00
levlam
cbb0166e7c Add "chat_boost" and "removed_chat_boost" updates. 2023-11-13 19:51:05 +03:00
levlam
4bb770f31a Add Chat.background_custom_emoji_id. 2023-11-13 19:15:19 +03:00
levlam
282e31f5fc Add Chat.accent_color_id. 2023-11-13 19:08:21 +03:00
levlam
704a4272dd Add Chat.has_visible_history. 2023-11-13 18:56:15 +03:00
levlam
b34c595eb0 Simplify update*FullInfo handling. 2023-11-13 18:53:04 +03:00
levlam
84f74d8ad6 Add Message.giveaway. 2023-11-13 18:38:57 +03:00
levlam
6a5393a925 Add Message.giveaway_created. 2023-11-13 18:22:04 +03:00
levlam
b81f8065d7 Support td_api::textEntityTypeBlockQuote. 2023-11-09 19:15:42 +03:00
levlam
13d68879d3 Add Client::get_same_chat_reply_to_message_id(const MessageInfo *message_info). 2023-11-09 18:24:50 +03:00
25 changed files with 2469 additions and 568 deletions

View File

@ -60,7 +60,7 @@ jobs:
cat $GITHUB_ENV > github.env
- name: Upload environment info as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: github_env
path: github.env
@ -130,7 +130,7 @@ jobs:
docker save tdlightbotapi:${{ env.HASH_VERSION }}-${{ env.SAFE_ARCH }} -o ${{ env.SAFE_ARCH }}.tar
- name: Upload image as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: image_${{ env.SAFE_ARCH }}
path: ${{ env.SAFE_ARCH }}.tar
@ -145,7 +145,7 @@ jobs:
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Load environment info and built images
run: |

View File

@ -36,7 +36,7 @@ jobs:
# Move index.html
mv dist/index.html .
# Fix references in index.html
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$SWAGGER_YAML|g" index.html
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$SWAGGER_YAML|g" ./dist/swagger-initializer.js
sed -i "s|href=\"./|href=\"dist/|g" index.html
sed -i "s|src=\"./|src=\"dist/|g" index.html
sed -i "s|dist/favicon|icons/favicon|g" index.html

View File

@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
project(TelegramBotApi VERSION 7.0 LANGUAGES CXX)
project(TelegramBotApi VERSION 7.10 LANGUAGES CXX)
if (POLICY CMP0069)
option(TELEGRAM_BOT_API_ENABLE_LTO "Use \"ON\" to enable Link Time Optimization.")

View File

@ -201,13 +201,16 @@
<option>Alpine</option>
<option>CentOS 7</option>
<option>CentOS 8</option>
<option>CentOS Stream 9</option>
<option>Debian 8/9</option>
<option>Debian 10+</option>
<option>Fedora 21+</option>
<option>Ubuntu 14</option>
<option>Ubuntu 16</option>
<option>Ubuntu 18</option>
<option>Ubuntu 20</option>
<option>Ubuntu 22</option>
<option>Ubuntu 24</option>
<option>Other</option>
</select>
<p></p>
@ -260,7 +263,7 @@
</div>
<div id="buildRootDiv" class="hide">
<label><input type="checkbox" id="buildRootCheckbox" onchange="onOptionsChanged()"/>Build from root user (unrecommended).</label>
<label><input type="checkbox" id="buildRootCheckbox" onchange="onOptionsChanged()"/>Build from root user (not recommended).</label>
</div>
<p></p>
@ -353,7 +356,7 @@ function onOptionsChanged() {
document.getElementById('buildCommandsDiv').style.display = 'block';
var use_clang = os_freebsd || os_openbsd;
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS')) {
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS') && !linux_distro.includes('Fedora')) {
document.getElementById('buildCompilerDiv').style.display = 'block';
use_clang = document.getElementById('buildCompilerRadioClang').checked;
} else {
@ -446,7 +449,7 @@ function onOptionsChanged() {
pre_text.push('Install Git, ' + compiler + ', make, CMake >= 3.0.2, OpenSSL-dev, zlib-dev, gperf using your package manager.');
}
if (os_freebsd) {
pre_text.push('Note that the following instruction is for FreeBSD 11.');
pre_text.push('Note that the following instruction is for FreeBSD 13.');
pre_text.push('Note that the following calls to <code>pkg</code> needs to be run as <code>root</code>.');
}
if (os_openbsd) {
@ -496,6 +499,19 @@ function onOptionsChanged() {
return '-10';
case 'Ubuntu 22':
return '-14';
case 'Ubuntu 24':
return '-18';
default:
return ''; // use default version
}
}
function getLibcplusplusVersionSuffix() {
switch (linux_distro) {
case 'Ubuntu 20':
case 'Ubuntu 22':
case 'Ubuntu 24':
return getClangVersionSuffix();
default:
return ''; // use default version
}
@ -514,23 +530,32 @@ function onOptionsChanged() {
commands.push(sudo + 'apk update');
commands.push(sudo + 'apk upgrade');
var packages = 'alpine-sdk linux-headers git zlib-dev openssl-dev gperf cmake';
commands.push(sudo + 'apk add --update ' + packages);
commands.push(sudo + 'apk add ' + packages);
break;
case 'CentOS 7':
case 'CentOS 8':
commands.push(sudo + 'yum update -y');
var packages = 'gcc-c++ make git zlib-devel openssl-devel';
if (linux_distro === 'CentOS 7') {
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';
} else {
commands.push(sudo + 'dnf --enablerepo=powertools install gperf');
}
packages += ' ' + 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');
if (linux_distro === 'CentOS 8') {
commands.push(sudo + 'dnf --enablerepo=powertools install gperf');
} else {
commands.push(sudo + 'dnf --enablerepo=crb install gperf');
}
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 cmake';
commands.push(sudo + 'dnf install -y ' + packages);
break;
case 'Debian 8/9':
case 'Debian 10+':
case 'Ubuntu 14':
@ -538,6 +563,7 @@ function onOptionsChanged() {
case 'Ubuntu 18':
case 'Ubuntu 20':
case 'Ubuntu 22':
case 'Ubuntu 24':
if (linux_distro.includes('Debian') && !use_root) {
commands.push('su -');
}
@ -553,9 +579,9 @@ function onOptionsChanged() {
packages += ' cmake';
}
if (use_clang) {
packages += ' clang' + getClangVersionSuffix() + ' libc++-dev';
if (linux_distro === 'Debian 10+' || linux_distro === 'Ubuntu 18' || linux_distro === 'Ubuntu 20' || linux_distro === 'Ubuntu 22') {
packages += ' libc++abi-dev';
packages += ' clang' + getClangVersionSuffix() + ' libc++' + getLibcplusplusVersionSuffix() + '-dev';
if (linux_distro === 'Debian 10+' || linux_distro === 'Ubuntu 18' || linux_distro === 'Ubuntu 20' || linux_distro === 'Ubuntu 22' || linux_distro === 'Ubuntu 24') {
packages += ' libc++abi' + getLibcplusplusVersionSuffix() + '-dev';
}
} else {
packages += ' g++';
@ -587,7 +613,7 @@ function onOptionsChanged() {
commands.push('su -');
}
commands.push('export PKG_PATH=http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r)/All');
var packages = 'git gperf cmake openssl gcc12-libs mozilla-rootcerts-openssl';
var packages = 'git gperf pcre2 cmake openssl gcc12-libs mozilla-rootcerts-openssl';
commands.push('pkg_add ' + packages);
if (!use_root) {
commands.push('exit');

2
td

@ -1 +1 @@
Subproject commit 27c3eaeb4964bd5f18d8488e354abde1a4383e49
Subproject commit 87d881071fe514936bb17029e96761141287d2be

View File

@ -264,6 +264,10 @@ paths:
last_name:
description: The last name of the user; 0-64 characters.
type: string
disable_notification:
description: Disables "user joined Telegram" notification for other users that have the contact in their contact list.
default: false
type: boolean
required:
- first_name
multipart/form-data:
@ -276,6 +280,10 @@ paths:
last_name:
description: The last name of the user; 0-64 characters.
type: string
disable_notification:
description: Disables "user joined Telegram" notification for other users that have the contact in their contact list.
default: false
type: boolean
required:
- first_name
application/json:
@ -288,6 +296,10 @@ paths:
last_name:
description: The last name of the user; 0-64 characters.
type: string
disable_notification:
description: Disables "user joined Telegram" notification for other users that have the contact in their contact list.
default: false
type: boolean
required:
- first_name
required: true
@ -1471,6 +1483,10 @@ paths:
query:
description: Query to search for.
type: string
only_in_channels:
description: Search for messages only in channels
default: false
type: boolean
offset_date:
description: The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the last message.
type: integer
@ -1505,6 +1521,10 @@ paths:
query:
description: Query to search for.
type: string
only_in_channels:
description: Search for messages only in channels
default: false
type: boolean
offset_date:
description: The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the last message.
type: integer
@ -1539,6 +1559,10 @@ paths:
query:
description: Query to search for.
type: string
only_in_channels:
description: Search for messages only in channels
default: false
type: boolean
offset_date:
description: The date of the message starting from which the results should be fetched. Use 0 or any date in the future to get results from the last message.
type: integer

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -106,6 +106,11 @@ class Client final : public WebhookActor::Callback {
class JsonUsers;
class JsonReactionType;
class JsonReactionCount;
class JsonBirthdate;
class JsonBusinessStartPage;
class JsonBusinessLocation;
class JsonBusinessOpeningHoursInterval;
class JsonBusinessOpeningHours;
class JsonChatPermissions;
class JsonChatPhotoInfo;
class JsonChatLocation;
@ -129,6 +134,8 @@ class Client final : public WebhookActor::Callback {
class JsonVideo;
class JsonVideoNote;
class JsonVoiceNote;
class JsonPaidMedia;
class JsonPaidMediaInfo;
class JsonContact;
class JsonDice;
class JsonGame;
@ -154,6 +161,7 @@ class Client final : public WebhookActor::Callback {
class JsonInlineCallbackQuery;
class JsonShippingQuery;
class JsonPreCheckoutQuery;
class JsonPaidMediaPurchased;
class JsonBotCommand;
class JsonBotMenuButton;
class JsonBotName;
@ -176,9 +184,16 @@ class Client final : public WebhookActor::Callback {
class JsonGameHighScore;
class JsonMessageReactionUpdated;
class JsonMessageReactionCountUpdated;
class JsonBusinessConnection;
class JsonBusinessMessagesDeleted;
class JsonAddress;
class JsonOrderInfo;
class JsonStory;
class JsonBackgroundFill;
class JsonBackgroundType;
class JsonChatBackground;
class JsonSuccessfulPaymentBot;
class JsonRefundedPayment;
class JsonEncryptedPassportElement;
class JsonEncryptedCredentials;
class JsonPassportData;
@ -190,11 +205,18 @@ class Client final : public WebhookActor::Callback {
class JsonChatSetMessageAutoDeleteTime;
class JsonWriteAccessAllowed;
class JsonUserShared;
class JsonSharedUser;
class JsonUsersShared;
class JsonChatShared;
class JsonGiveawayCreated;
class JsonGiveaway;
class JsonGiveawayWinners;
class JsonGiveawayCompleted;
class JsonChatBoostAdded;
class JsonRevenueWithdrawalState;
class JsonStarTransactionPartner;
class JsonStarTransaction;
class JsonStarTransactions;
class JsonUpdateTypes;
class JsonWebhookInfo;
class JsonStickerSet;
@ -218,12 +240,15 @@ class Client final : public WebhookActor::Callback {
class TdOnInitCallback;
class TdOnGetUserProfilePhotosCallback;
class TdOnSendMessageCallback;
class TdOnReturnBusinessMessageCallback;
class TdOnSendMessageAlbumCallback;
class TdOnSendBusinessMessageAlbumCallback;
class TdOnForwardMessagesCallback;
class TdOnDeleteFailedToSendMessageCallback;
class TdOnEditMessageCallback;
class TdOnEditInlineMessageCallback;
class TdOnStopPollCallback;
class TdOnStopBusinessPollCallback;
class TdOnOkQueryCallback;
class TdOnGetReplyMessageCallback;
class TdOnGetEditedMessageCallback;
@ -238,6 +263,8 @@ class Client final : public WebhookActor::Callback {
class TdOnGetMyShortDescriptionCallback;
class TdOnGetChatFullInfoCallback;
class TdOnGetChatStickerSetCallback;
class TdOnGetChatCustomEmojiStickerSetCallback;
class TdOnGetChatBusinessStartPageStickerSetCallback;
class TdOnGetChatPinnedMessageCallback;
class TdOnGetChatPinnedMessageToUnpinCallback;
class TdOnGetGroupMembersCallback;
@ -245,6 +272,7 @@ class Client final : public WebhookActor::Callback {
class TdOnGetSupergroupMemberCountCallback;
class TdOnGetUserChatBoostsCallback;
class TdOnCreateInvoiceLinkCallback;
class TdOnGetStarTransactionsQueryCallback;
class TdOnReplacePrimaryChatInviteLinkCallback;
class TdOnGetChatInviteLinkCallback;
class TdOnGetGameHighScoresCallback;
@ -278,10 +306,13 @@ class Client final : public WebhookActor::Callback {
void on_get_callback_query_message(object_ptr<td_api::message> message, int64 user_id, int state);
void on_get_sticker_set(int64 set_id, int64 new_callback_query_user_id, int64 new_message_chat_id,
object_ptr<td_api::stickerSet> sticker_set);
const td::string &new_message_business_connection_id,
int64 new_business_callback_query_user_id, object_ptr<td_api::text> sticker_set_name);
void on_get_sticker_set_name(int64 set_id, const td::string &name);
void on_get_sticker_set_name(int64 set_id, object_ptr<td_api::Object> sticker_set_name);
class TdQueryCallback {
public:
virtual void on_result(object_ptr<td_api::Object> result) = 0;
@ -334,6 +365,8 @@ class Client final : public WebhookActor::Callback {
template <class OnSuccess>
class TdOnCheckMessageThreadCallback;
template <class OnSuccess>
class TdOnCheckBusinessConnectionCallback;
template <class OnSuccess>
class TdOnCheckRemoteFileIdCallback;
template <class OnSuccess>
class TdOnGetChatMemberCallback;
@ -362,6 +395,16 @@ class Client final : public WebhookActor::Callback {
template <class OnSuccess>
void check_chat_no_fail(td::Slice chat_id_str, PromisedQueryPtr query, OnSuccess on_success);
static td::Result<int64> get_business_connection_chat_id(td::Slice chat_id_str);
template <class OnSuccess>
void check_business_connection(const td::string &business_connection_id, PromisedQueryPtr query,
OnSuccess on_success);
template <class OnSuccess>
void check_business_connection_chat_id(const td::string &business_connection_id, const td::string &chat_id_str,
PromisedQueryPtr query, OnSuccess on_success);
template <class OnSuccess>
void check_bot_command_scope(BotCommandScope &&scope, PromisedQueryPtr query, OnSuccess on_success);
@ -416,6 +459,8 @@ class Client final : public WebhookActor::Callback {
static object_ptr<td_api::InputMessageReplyTo> get_input_message_reply_to(CheckedReplyParameters &&reply_parameters);
static object_ptr<td_api::InputMessageReplyTo> get_input_message_reply_to(InputReplyParameters &&reply_parameters);
static td::Result<InputReplyParameters> get_reply_parameters(const Query *query);
static td::Result<InputReplyParameters> get_reply_parameters(td::JsonValue &&value);
@ -514,14 +559,17 @@ class Client final : public WebhookActor::Callback {
static td::Result<object_ptr<td_api::StickerFormat>> get_sticker_format(td::Slice sticker_format);
td::Result<object_ptr<td_api::inputSticker>> get_legacy_input_sticker(const Query *query) const;
td::Result<object_ptr<td_api::inputSticker>> get_input_sticker(const Query *query) const;
td::Result<object_ptr<td_api::inputSticker>> get_input_sticker(const Query *query, td::JsonValue &&value) const;
td::Result<object_ptr<td_api::inputSticker>> get_input_sticker(const Query *query, td::JsonValue &&value,
td::Slice default_sticker_format) const;
td::Result<td::vector<object_ptr<td_api::inputSticker>>> get_input_stickers(
const Query *query, object_ptr<td_api::StickerFormat> &sticker_format) const;
td::Result<td::vector<object_ptr<td_api::inputSticker>>> get_input_stickers(const Query *query) const;
static td::Result<object_ptr<td_api::InputFile>> get_sticker_input_file(const Query *query);
static td::Result<object_ptr<td_api::InputFile>> get_sticker_input_file(const Query *query,
td::Slice field_name = "sticker");
static td::Result<td::string> get_passport_element_hash(td::Slice encoded_hash);
@ -572,13 +620,24 @@ class Client final : public WebhookActor::Callback {
td::Result<td::vector<object_ptr<td_api::InputMessageContent>>> get_input_message_contents(
const Query *query, td::JsonValue &&value) const;
td::Result<object_ptr<td_api::inputPaidMedia>> get_input_paid_media(const Query *query,
td::JsonValue &&input_media) const;
td::Result<object_ptr<td_api::inputPaidMedia>> get_input_paid_media(const Query *query, td::Slice field_name) const;
td::Result<td::vector<object_ptr<td_api::inputPaidMedia>>> get_paid_media(const Query *query,
td::Slice field_name) const;
td::Result<td::vector<object_ptr<td_api::inputPaidMedia>>> get_paid_media(const Query *query,
td::JsonValue &&value) const;
td::Result<object_ptr<td_api::inputMessageInvoice>> get_input_message_invoice(const Query *query) const;
static object_ptr<td_api::messageSendOptions> get_message_send_options(bool disable_notification,
bool protect_content,
bool protect_content, int64 effect_id,
object_ptr<td_api::MessageSchedulingState> &&scheduling_state);
static td::Result<td::vector<td::string>> get_poll_options(const Query *query);
static td::Result<td::vector<object_ptr<td_api::formattedText>>> get_poll_options(const Query *query);
static td::Result<object_ptr<td_api::ReactionType>> get_reaction_type(td::JsonValue &&value);
@ -658,6 +717,7 @@ class Client final : public WebhookActor::Callback {
td::Status process_send_video_query(PromisedQueryPtr &query);
td::Status process_send_video_note_query(PromisedQueryPtr &query);
td::Status process_send_voice_query(PromisedQueryPtr &query);
td::Status process_send_paid_media_query(PromisedQueryPtr &query);
td::Status process_send_game_query(PromisedQueryPtr &query);
td::Status process_send_invoice_query(PromisedQueryPtr &query);
td::Status process_send_location_query(PromisedQueryPtr &query);
@ -680,6 +740,8 @@ class Client final : public WebhookActor::Callback {
td::Status process_delete_message_query(PromisedQueryPtr &query);
td::Status process_delete_messages_query(PromisedQueryPtr &query);
td::Status process_create_invoice_link_query(PromisedQueryPtr &query);
td::Status process_get_star_transactions_query(PromisedQueryPtr &query);
td::Status process_refund_star_payment_query(PromisedQueryPtr &query);
td::Status process_set_game_score_query(PromisedQueryPtr &query);
td::Status process_get_game_high_scores_query(PromisedQueryPtr &query);
td::Status process_answer_web_app_query_query(PromisedQueryPtr &query);
@ -689,8 +751,11 @@ class Client final : public WebhookActor::Callback {
td::Status process_answer_pre_checkout_query_query(PromisedQueryPtr &query);
td::Status process_export_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_create_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_create_chat_subscription_invite_link_query(PromisedQueryPtr &query);
td::Status process_edit_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_edit_chat_subscription_invite_link_query(PromisedQueryPtr &query);
td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_get_business_connection_query(PromisedQueryPtr &query);
td::Status process_get_chat_query(PromisedQueryPtr &query);
td::Status process_set_chat_photo_query(PromisedQueryPtr &query);
td::Status process_delete_chat_photo_query(PromisedQueryPtr &query);
@ -734,6 +799,7 @@ class Client final : public WebhookActor::Callback {
td::Status process_upload_sticker_file_query(PromisedQueryPtr &query);
td::Status process_create_new_sticker_set_query(PromisedQueryPtr &query);
td::Status process_add_sticker_to_set_query(PromisedQueryPtr &query);
td::Status process_replace_sticker_in_set_query(PromisedQueryPtr &query);
td::Status process_set_sticker_set_title_query(PromisedQueryPtr &query);
td::Status process_set_sticker_set_thumbnail_query(PromisedQueryPtr &query);
td::Status process_set_custom_emoji_sticker_set_thumbnail_query(PromisedQueryPtr &query);
@ -850,6 +916,8 @@ class Client final : public WebhookActor::Callback {
static void fail_query_with_error(PromisedQueryPtr &&query, object_ptr<td_api::error> error,
td::Slice default_message = td::Slice());
static bool is_special_error_code(int32 error_code);
class JsonUpdates;
void do_get_updates(int32 offset, int32 limit, int32 timeout, PromisedQueryPtr query);
@ -875,6 +943,9 @@ class Client final : public WebhookActor::Callback {
object_ptr<td_api::chatPhoto> photo;
td::string bio;
object_ptr<td_api::birthdate> birthdate;
object_ptr<td_api::businessInfo> business_info;
int64 personal_chat_id = 0;
// start custom properties
bool is_verified = false;
@ -885,9 +956,11 @@ class Client final : public WebhookActor::Callback {
bool have_access = false;
bool can_join_groups = false;
bool can_read_all_group_messages = false;
bool is_inline_bot = false;
bool can_connect_to_business = 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;
};
@ -918,8 +991,10 @@ class Client final : public WebhookActor::Callback {
td::string description;
td::string invite_link;
int64 sticker_set_id = 0;
int64 custom_emoji_sticker_set_id = 0;
int32 date = 0;
int32 slow_mode_delay = 0;
int32 unrestrict_boost_count = 0;
int64 linked_chat_id = 0;
object_ptr<td_api::chatLocation> location;
object_ptr<td_api::ChatMemberStatus> status;
@ -932,6 +1007,7 @@ class Client final : public WebhookActor::Callback {
bool join_by_request = false;
bool has_hidden_members = false;
bool has_aggressive_anti_spam_enabled = false;
bool has_paid_media_allowed = false;
// start custom properties
bool is_verified = false;
@ -954,6 +1030,7 @@ class Client final : public WebhookActor::Callback {
int64 background_custom_emoji_id = 0;
int64 profile_background_custom_emoji_id = 0;
bool has_protected_content = false;
int32 max_reaction_count = 0;
object_ptr<td_api::chatAvailableReactionsSome> available_reactions;
object_ptr<td_api::chatPhotoInfo> photo_info;
object_ptr<td_api::chatPermissions> permissions;
@ -966,6 +1043,9 @@ class Client final : public WebhookActor::Callback {
ChatInfo *add_chat(int64 chat_id);
const ChatInfo *get_chat(int64 chat_id) const;
void set_chat_available_reactions(ChatInfo *chat_info,
object_ptr<td_api::ChatAvailableReactions> &&available_reactions);
enum class ChatType { Private, Group, Supergroup, Channel, Unknown };
ChatType get_chat_type(int64 chat_id) const;
@ -981,13 +1061,19 @@ class Client final : public WebhookActor::Callback {
int32 date = 0;
int32 edit_date = 0;
int32 initial_send_date = 0;
int32 sender_boost_count = 0;
object_ptr<td_api::MessageOrigin> forward_origin;
td::string author_signature;
td::unique_ptr<MessageInfo> business_reply_to_message;
object_ptr<td_api::messageReplyToMessage> reply_to_message;
object_ptr<td_api::messageReplyToStory> reply_to_story;
int64 media_album_id = 0;
int64 via_bot_user_id = 0;
object_ptr<td_api::MessageContent> content;
object_ptr<td_api::ReplyMarkup> reply_markup;
td::string business_connection_id;
int64 sender_business_bot_user_id = 0;
int64 effect_id = 0;
// start custom properties
int32 views = 0;
@ -1000,9 +1086,22 @@ class Client final : public WebhookActor::Callback {
bool can_be_saved = false;
bool is_automatic_forward = false;
bool is_topic_message = false;
bool is_from_offline = false;
mutable bool is_content_changed = false;
};
struct BusinessConnection {
td::string id_;
int64 user_id_ = 0;
int64 user_chat_id_ = 0;
int32 date_ = 0;
bool can_reply_ = false;
bool is_enabled_ = false;
};
const BusinessConnection *add_business_connection(object_ptr<td_api::businessConnection> &&business_connection,
bool from_update);
const BusinessConnection *get_business_connection(const td::string &connection_id) const;
static int64 get_same_chat_reply_to_message_id(const td_api::messageReplyToMessage *reply_to,
int64 message_thread_id);
@ -1027,7 +1126,7 @@ class Client final : public WebhookActor::Callback {
static bool are_equal_inline_keyboards(const td_api::replyMarkupInlineKeyboard *lhs,
const td_api::replyMarkupInlineKeyboard *rhs);
void set_message_reply_markup(MessageInfo *message_info, object_ptr<td_api::ReplyMarkup> &&reply_markup);
static void set_message_reply_markup(MessageInfo *message_info, object_ptr<td_api::ReplyMarkup> &&reply_markup);
static int64 get_sticker_set_id(const object_ptr<td_api::MessageContent> &content);
@ -1061,6 +1160,12 @@ class Client final : public WebhookActor::Callback {
void process_new_message_queue(int64 chat_id, int state);
void add_new_business_message(object_ptr<td_api::updateNewBusinessMessage> &&update);
void add_business_message_edited(object_ptr<td_api::updateBusinessMessageEdited> &&update);
void process_new_business_message_queue(const td::string &connection_id);
struct FullMessageId {
int64 chat_id;
int64 message_id;
@ -1082,9 +1187,13 @@ class Client final : public WebhookActor::Callback {
};
FullMessageId add_message(object_ptr<td_api::message> &&message, bool force_update_content = false);
void init_message(MessageInfo *message_info, object_ptr<td_api::message> &&message, bool force_update_content);
const MessageInfo *get_message(int64 chat_id, int64 message_id, bool force_cache) const;
MessageInfo *get_message_editable(int64 chat_id, int64 message_id);
td::unique_ptr<MessageInfo> create_business_message(td::string business_connection_id,
object_ptr<td_api::businessMessage> &&message);
void update_message_content(int64 chat_id, int64 message_id, object_ptr<td_api::MessageContent> &&content);
void on_update_message_edited(int64 chat_id, int64 message_id, int32 edit_date,
@ -1119,12 +1228,18 @@ class Client final : public WebhookActor::Callback {
void process_new_callback_query_queue(int64 user_id, int state);
void add_new_business_callback_query(object_ptr<td_api::updateNewBusinessCallbackQuery> &&query);
void process_new_business_callback_query_queue(int64 user_id);
void add_new_inline_callback_query(object_ptr<td_api::updateNewInlineCallbackQuery> &&query);
void add_new_shipping_query(object_ptr<td_api::updateNewShippingQuery> &&query);
void add_new_pre_checkout_query(object_ptr<td_api::updateNewPreCheckoutQuery> &&query);
void add_update_purchased_paid_media(object_ptr<td_api::updatePaidMediaPurchased> &&query);
void add_new_custom_event(object_ptr<td_api::updateNewCustomEvent> &&event);
void add_new_custom_query(object_ptr<td_api::updateNewCustomQuery> &&query);
@ -1139,6 +1254,10 @@ class Client final : public WebhookActor::Callback {
void add_update_message_reaction_count(object_ptr<td_api::updateMessageReactions> &&update);
void add_update_business_connection(object_ptr<td_api::updateBusinessConnection> &&update);
void add_update_business_messages_deleted(object_ptr<td_api::updateBusinessMessagesDeleted> &&update);
// append only before Size
enum class UpdateType : int32 {
Message,
@ -1161,6 +1280,11 @@ class Client final : public WebhookActor::Callback {
ChatBoostRemoved,
MessageReaction,
MessageReactionCount,
BusinessConnection,
BusinessMessage,
EditedBusinessMessage,
BusinessMessagesDeleted,
PurchasedPaidMedia,
Size
};
@ -1232,6 +1356,7 @@ class Client final : public WebhookActor::Callback {
td::WaitFreeHashMap<int64, td::unique_ptr<GroupInfo>> groups_;
td::WaitFreeHashMap<int64, td::unique_ptr<SupergroupInfo>> supergroups_;
td::WaitFreeHashMap<int64, td::unique_ptr<ChatInfo>> chats_;
td::WaitFreeHashMap<td::string, td::unique_ptr<BusinessConnection>> business_connections_;
td::FlatHashMap<int32, td::vector<PromisedQueryPtr>> file_download_listeners_;
td::FlatHashSet<int32> download_started_file_ids_;
@ -1269,12 +1394,32 @@ class Client final : public WebhookActor::Callback {
};
td::FlatHashMap<int64, NewMessageQueue> new_message_queues_; // chat_id -> queue
struct NewBusinessMessage {
object_ptr<td_api::businessMessage> message_;
bool is_edited_ = false;
NewBusinessMessage(object_ptr<td_api::businessMessage> &&message, bool is_edited)
: message_(std::move(message)), is_edited_(is_edited) {
}
};
struct NewBusinessMessageQueue {
std::queue<NewBusinessMessage> queue_;
bool has_active_request_ = false;
};
td::FlatHashMap<td::string, NewBusinessMessageQueue> new_business_message_queues_; // connection_id -> queue
struct NewCallbackQueryQueue {
std::queue<object_ptr<td_api::updateNewCallbackQuery>> queue_;
bool has_active_request_ = false;
};
td::FlatHashMap<int64, NewCallbackQueryQueue> new_callback_query_queues_; // sender_user_id -> queue
struct NewBusinessCallbackQueryQueue {
std::queue<object_ptr<td_api::updateNewBusinessCallbackQuery>> queue_;
bool has_active_request_ = false;
};
td::FlatHashMap<int64, NewBusinessCallbackQueryQueue> new_business_callback_query_queues_; // sender_user_id -> queue
td::WaitFreeHashMap<int64, td::string> sticker_set_names_;
td::WaitFreeHashMap<int64, double> last_send_message_time_;

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021, Luckydonald (tdlight-telegram-bot-api+code@luckydonald.de) 2020
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024, Luckydonald (tdlight-telegram-bot-api+code@luckydonald.de) 2020
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -100,6 +100,11 @@ void ClientManager::send(PromisedQueryPtr query) {
auto id_it = token_to_id_.find(token);
if (id_it == token_to_id_.end()) {
auto method = query->method();
if (method == "close") {
return fail_query(400, "Bad Request: the bot has already been closed", std::move(query));
}
if (!check_flood_limits(query)) {
return;
}
@ -116,7 +121,6 @@ void ClientManager::send(PromisedQueryPtr query) {
query->token().str(), query->is_user(), query->is_test_dc(),
tqueue_id, parameters_, client_info->stat_.actor_id(&client_info->stat_));
auto method = query->method();
if (method != "deletewebhook" && method != "setwebhook") {
auto webhook_info = parameters_->shared_data_->webhook_db_->get(bot_token_with_dc);
if (!webhook_info.empty()) {

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -590,8 +590,7 @@ void WebhookActor::send_updates() {
void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) {
SCOPE_EXIT {
bool dummy = false;
td::Scheduler::instance()->destroy_on_scheduler(SharedData::get_file_gc_scheduler_id(), response, dummy);
td::Scheduler::instance()->destroy_on_scheduler_unique_ptr(SharedData::get_file_gc_scheduler_id(), response);
};
auto connection_id = get_link_token();

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,5 +1,5 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -103,6 +103,7 @@ static void dump_stacktrace_signal_handler(int sig) {
static void fail_signal_handler(int sig) {
has_failed = true;
print_log();
{
td::LogGuard log_guard;
td::signal_safe_write_signal_number(sig);
@ -110,7 +111,6 @@ static void fail_signal_handler(int sig) {
options.use_gdb = true;
td::Stacktrace::print_to_stderr(options);
}
print_log();
_Exit(EXIT_FAILURE);
}
@ -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.0";
parameters->version_ = "7.10";
parameters->shared_data_ = shared_data;
parameters->start_time_ = start_time;
auto net_query_stats = td::create_net_query_stats();