Skip to content

Commit

Permalink
Merge branch 'tdlib:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pylakey authored Sep 19, 2023
2 parents 958fed6 + daf4801 commit ceee1ad
Show file tree
Hide file tree
Showing 356 changed files with 23,229 additions and 7,253 deletions.
3 changes: 2 additions & 1 deletion CMake/TdSetUpCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function(td_set_up_compiler)
add_cxx_compiler_flag("-Wdeprecated")
add_cxx_compiler_flag("-Wno-unused-command-line-argument")
add_cxx_compiler_flag("-Qunused-arguments")
add_cxx_compiler_flag("-Wno-unknown-warning-option")
add_cxx_compiler_flag("-Wodr")
add_cxx_compiler_flag("-flto-odr-type-merging")

Expand All @@ -135,7 +136,7 @@ function(td_set_up_compiler)
# add_cxx_compiler_flag("-Wzero-as-null-pointer-constant")
endif()

if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
if (GCC)
add_cxx_compiler_flag("-Wno-maybe-uninitialized") # too many false positives
endif()
if (WIN32 AND GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0))
Expand Down
12 changes: 9 additions & 3 deletions CMake/iOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,19 @@ set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS su
# Set the architectures unless specified manually with IOS_ARCH
if (NOT DEFINED IOS_ARCH)
if (IOS_PLATFORM STREQUAL "OS")
set (IOS_ARCH "armv7;armv7s;arm64")
set (IOS_ARCH "arm64")
elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
set (IOS_ARCH "i386;x86_64;arm64")
set (IOS_ARCH "x86_64;arm64")
elseif (IOS_PLATFORM STREQUAL "WATCHOS")
set (IOS_ARCH "armv7k;arm64_32;arm64")

# Include C++ Standard Library for Xcode 15 builds.
include_directories(SYSTEM "${CMAKE_IOS_SDK_ROOT}/usr/include/c++/v1")
elseif (IOS_PLATFORM STREQUAL "WATCHSIMULATOR")
set (IOS_ARCH "i386;x86_64;arm64")
set (IOS_ARCH "x86_64;arm64")

# Include C++ Standard Library for Xcode 15 builds.
include_directories(SYSTEM "${CMAKE_IOS_SDK_ROOT}/usr/include/c++/v1")
elseif (IOS_PLATFORM STREQUAL "TVOS")
set (IOS_ARCH "arm64")
elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR")
Expand Down
57 changes: 53 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()

project(TDLib VERSION 1.8.14 LANGUAGES CXX C)
project(TDLib VERSION 1.8.18 LANGUAGES CXX C)

if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")
Expand Down Expand Up @@ -285,7 +285,7 @@ set(TDLIB_SOURCE
td/mtproto/Transport.cpp
td/mtproto/utils.cpp

td/telegram/Account.cpp
td/telegram/AccountManager.cpp
td/telegram/AnimationsManager.cpp
td/telegram/Application.cpp
td/telegram/AttachMenuManager.cpp
Expand Down Expand Up @@ -369,6 +369,7 @@ set(TDLIB_SOURCE
td/telegram/Game.cpp
td/telegram/GameManager.cpp
td/telegram/Global.cpp
td/telegram/GlobalPrivacySettings.cpp
td/telegram/GroupCallManager.cpp
td/telegram/GroupCallParticipant.cpp
td/telegram/GroupCallParticipantOrder.cpp
Expand All @@ -385,12 +386,15 @@ set(TDLIB_SOURCE
td/telegram/Location.cpp
td/telegram/logevent/LogEventHelper.cpp
td/telegram/Logging.cpp
td/telegram/MediaArea.cpp
td/telegram/MediaAreaCoordinates.cpp
td/telegram/MessageContent.cpp
td/telegram/MessageContentType.cpp
td/telegram/MessageDb.cpp
td/telegram/MessageEntity.cpp
td/telegram/MessageExtendedMedia.cpp
td/telegram/MessageId.cpp
td/telegram/MessageInputReplyTo.cpp
td/telegram/MessageReaction.cpp
td/telegram/MessageReplyHeader.cpp
td/telegram/MessageReplyInfo.cpp
Expand Down Expand Up @@ -422,6 +426,8 @@ set(TDLIB_SOURCE
td/telegram/net/SessionProxy.cpp
td/telegram/net/SessionMultiProxy.cpp
td/telegram/NewPasswordState.cpp
td/telegram/NotificationGroupInfo.cpp
td/telegram/NotificationGroupType.cpp
td/telegram/NotificationManager.cpp
td/telegram/NotificationSettingsScope.cpp
td/telegram/NotificationSettingsManager.cpp
Expand All @@ -442,6 +448,8 @@ set(TDLIB_SOURCE
td/telegram/PremiumGiftOption.cpp
td/telegram/QueryCombiner.cpp
td/telegram/QueryMerger.cpp
td/telegram/ReactionManager.cpp
td/telegram/ReactionType.cpp
td/telegram/RecentDialogList.cpp
td/telegram/ReplyMarkup.cpp
td/telegram/ReportReason.cpp
Expand All @@ -468,6 +476,13 @@ set(TDLIB_SOURCE
td/telegram/StickersManager.cpp
td/telegram/StickerType.cpp
td/telegram/StorageManager.cpp
td/telegram/StoryContent.cpp
td/telegram/StoryContentType.cpp
td/telegram/StoryDb.cpp
td/telegram/StoryInteractionInfo.cpp
td/telegram/StoryManager.cpp
td/telegram/StoryStealthMode.cpp
td/telegram/StoryViewer.cpp
td/telegram/SuggestedAction.cpp
td/telegram/Support.cpp
td/telegram/Td.cpp
Expand All @@ -480,6 +495,8 @@ set(TDLIB_SOURCE
td/telegram/TranslationManager.cpp
td/telegram/UpdatesManager.cpp
td/telegram/Usernames.cpp
td/telegram/UserPrivacySetting.cpp
td/telegram/UserPrivacySettingRule.cpp
td/telegram/Venue.cpp
td/telegram/VideoNotesManager.cpp
td/telegram/VideosManager.cpp
Expand Down Expand Up @@ -518,7 +535,7 @@ set(TDLIB_SOURCE
td/mtproto/utils.h

td/telegram/AccessRights.h
td/telegram/Account.h
td/telegram/AccountManager.h
td/telegram/AffectedHistory.h
td/telegram/AnimationsManager.h
td/telegram/Application.h
Expand All @@ -531,6 +548,7 @@ set(TDLIB_SOURCE
td/telegram/BackgroundInfo.h
td/telegram/BackgroundManager.h
td/telegram/BackgroundType.h
td/telegram/BlockListId.h
td/telegram/BotCommand.h
td/telegram/BotCommandScope.h
td/telegram/BotInfoManager.h
Expand Down Expand Up @@ -626,6 +644,7 @@ set(TDLIB_SOURCE
td/telegram/GameManager.h
td/telegram/GitCommitHash.h
td/telegram/Global.h
td/telegram/GlobalPrivacySettings.h
td/telegram/GroupCallId.h
td/telegram/GroupCallManager.h
td/telegram/GroupCallParticipant.h
Expand All @@ -646,13 +665,16 @@ set(TDLIB_SOURCE
td/telegram/logevent/LogEventHelper.h
td/telegram/logevent/SecretChatEvent.h
td/telegram/Logging.h
td/telegram/MediaArea.h
td/telegram/MediaAreaCoordinates.h
td/telegram/MessageContent.h
td/telegram/MessageContentType.h
td/telegram/MessageCopyOptions.h
td/telegram/MessageDb.h
td/telegram/MessageEntity.h
td/telegram/MessageExtendedMedia.h
td/telegram/MessageId.h
td/telegram/MessageInputReplyTo.h
td/telegram/MessageLinkInfo.h
td/telegram/MessageReaction.h
td/telegram/MessageReplyHeader.h
Expand Down Expand Up @@ -694,11 +716,15 @@ set(TDLIB_SOURCE
td/telegram/net/TempAuthKeyWatchdog.h
td/telegram/NewPasswordState.h
td/telegram/Notification.h
td/telegram/NotificationGroupFromDatabase.h
td/telegram/NotificationGroupId.h
td/telegram/NotificationGroupInfo.h
td/telegram/NotificationGroupKey.h
td/telegram/NotificationGroupType.h
td/telegram/NotificationId.h
td/telegram/NotificationManager.h
td/telegram/NotificationObjectFullId.h
td/telegram/NotificationObjectId.h
td/telegram/NotificationSettingsScope.h
td/telegram/NotificationSettingsManager.h
td/telegram/NotificationSound.h
Expand All @@ -723,6 +749,8 @@ set(TDLIB_SOURCE
td/telegram/PublicDialogType.h
td/telegram/QueryCombiner.h
td/telegram/QueryMerger.h
td/telegram/ReactionManager.h
td/telegram/ReactionType.h
td/telegram/RecentDialogList.h
td/telegram/ReplyMarkup.h
td/telegram/ReportReason.h
Expand Down Expand Up @@ -755,6 +783,17 @@ set(TDLIB_SOURCE
td/telegram/StickersManager.h
td/telegram/StickerType.h
td/telegram/StorageManager.h
td/telegram/StoryContent.h
td/telegram/StoryContentType.h
td/telegram/StoryDb.h
td/telegram/StoryFullId.h
td/telegram/StoryId.h
td/telegram/StoryInteractionInfo.h
td/telegram/StoryListId.h
td/telegram/StoryManager.h
td/telegram/StoryNotificationSettings.h
td/telegram/StoryStealthMode.h
td/telegram/StoryViewer.h
td/telegram/SuggestedAction.h
td/telegram/Support.h
td/telegram/Td.h
Expand All @@ -770,6 +809,8 @@ set(TDLIB_SOURCE
td/telegram/UpdatesManager.h
td/telegram/UserId.h
td/telegram/Usernames.h
td/telegram/UserPrivacySetting.h
td/telegram/UserPrivacySettingRule.h
td/telegram/Venue.h
td/telegram/Version.h
td/telegram/VideoNotesManager.h
Expand All @@ -785,6 +826,7 @@ set(TDLIB_SOURCE
td/telegram/AuthManager.hpp
td/telegram/BackgroundInfo.hpp
td/telegram/BackgroundType.hpp
td/telegram/ChatReactions.hpp
td/telegram/DialogNotificationSettings.hpp
td/telegram/DialogFilter.hpp
td/telegram/Dimensions.hpp
Expand All @@ -805,18 +847,23 @@ set(TDLIB_SOURCE
td/telegram/Game.hpp
td/telegram/InputInvoice.hpp
td/telegram/InputMessageText.hpp
td/telegram/MediaArea.hpp
td/telegram/MediaAreaCoordinates.hpp
td/telegram/MessageEntity.hpp
td/telegram/MessageExtendedMedia.hpp
td/telegram/MessageReaction.hpp
td/telegram/MessageReplyInfo.hpp
td/telegram/MinChannel.hpp
td/telegram/NotificationGroupInfo.hpp
td/telegram/OrderInfo.hpp
td/telegram/Photo.hpp
td/telegram/PhotoSize.hpp
td/telegram/PhotoSizeSource.hpp
td/telegram/PollId.hpp
td/telegram/PollManager.hpp
td/telegram/PremiumGiftOption.hpp
td/telegram/ReactionManager.hpp
td/telegram/ReactionType.hpp
td/telegram/ReplyMarkup.hpp
td/telegram/RequestedDialogType.hpp
td/telegram/ScopeNotificationSettings.hpp
Expand All @@ -825,6 +872,8 @@ set(TDLIB_SOURCE
td/telegram/StickerMaskPosition.hpp
td/telegram/StickerPhotoSize.hpp
td/telegram/StickersManager.hpp
td/telegram/StoryInteractionInfo.hpp
td/telegram/StoryStealthMode.hpp
td/telegram/TranscriptionInfo.hpp
td/telegram/VideoNotesManager.hpp
td/telegram/VideosManager.hpp
Expand Down Expand Up @@ -874,7 +923,7 @@ target_link_libraries(tdapi PRIVATE tdutils)

if (TD_ENABLE_JNI AND NOT ANDROID) # jni is available by default on Android
if (NOT JNI_FOUND)
find_package(JNI REQUIRED)
find_package(JNI REQUIRED COMPONENTS JVM)
endif()
message(STATUS "Found JNI: ${JNI_INCLUDE_DIRS} ${JNI_LIBRARIES}")
target_include_directories(tdapi PUBLIC ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic)

Or you could install `TDLib` and then reference it in your CMakeLists.txt like this:
```
find_package(Td 1.8.14 REQUIRED)
find_package(Td 1.8.18 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
```
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/blob/master/example/cpp/CMakeLists.txt).
Expand Down
4 changes: 4 additions & 0 deletions SplitSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ function ($matches) use ($needed_std_headers) {

if (!preg_match('/Td::~?Td/', $new_content)) { // destructor Td::~Td needs to see definitions of all forward-declared classes
$td_methods = array(
'account_manager[_(-][^.]|AccountManager[^;>]' => "AccountManager",
'animations_manager[_(-][^.]|AnimationsManager[^;>]' => "AnimationsManager",
'attach_menu_manager[_(-][^.]|AttachMenuManager[^;>]' => "AttachMenuManager",
'audios_manager[_(-][^.]|AudiosManager' => "AudiosManager",
Expand Down Expand Up @@ -306,11 +307,14 @@ function ($matches) use ($needed_std_headers) {
'option_manager[_(-][^.]|OptionManager' => "OptionManager",
'phone_number_manager[_(-][^.]|PhoneNumberManager' => "PhoneNumberManager",
'poll_manager[_(-][^.]|PollManager' => "PollManager",
'privacy_manager[_(-][^.]|PrivacyManager' => "PrivacyManager",
'PublicDialogType|get_public_dialog_type' => 'PublicDialogType',
'reaction_manager[_(-][^.]|ReactionManager' => 'ReactionManager',
'SecretChatActor' => 'SecretChatActor',
'secret_chats_manager[_(-]|SecretChatsManager' => 'SecretChatsManager',
'sponsored_message_manager[_(-][^.]|SponsoredMessageManager' => 'SponsoredMessageManager',
'stickers_manager[_(-][^.]|StickersManager' => 'StickersManager',
'story_manager[_(-][^.]|StoryManager' => 'StoryManager',
'[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb',
'theme_manager[_(-][^.]|ThemeManager' => "ThemeManager",
'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bench_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class F {

template <class T>
void operator()(const T &x) const {
sum += static_cast<td::uint32>(x.get_id());
sum += static_cast<td::uint32>(reinterpret_cast<std::uintptr_t>(&x));
}
};

Expand Down
2 changes: 0 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ See [example/csharp](https://github.com/tdlib/td/tree/master/example/csharp) for
If you want to write a cross-platform C# application using .NET Core, see [tdsharp](https://github.com/egramtel/tdsharp). It uses our [JSON](https://github.com/tdlib/td#using-json) interface,
provides an asynchronous interface for interaction with TDLib, automatically generated classes for TDLib API and has some examples.

You can also use [TDLibCore](https://github.com/ph09nix/TDLibCore) library.

Also, see [Unigram](https://github.com/UnigramDev/Unigram), which is a full-featured client rewritten from scratch in C# using TDLib SDK for Universal Windows Platform in less than 2 months,
[egram.tel](https://github.com/egramtel/egram.tel) – a cross-platform Telegram client written in C#, .NET Core, ReactiveUI and Avalonia, or
[telewear](https://github.com/telewear/telewear) - a Telegram client for Samsung watches.
Expand Down
2 changes: 1 addition & 1 deletion example/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR)

project(TdExample VERSION 1.0 LANGUAGES CXX)

find_package(Td 1.8.14 REQUIRED)
find_package(Td 1.8.18 REQUIRED)

add_executable(tdjson_example tdjson_example.cpp)
target_link_libraries(tdjson_example PRIVATE Td::TdJson)
Expand Down
2 changes: 1 addition & 1 deletion example/csharp/TdExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private static void sendMessage(long chatId, string message)
TdApi.ReplyMarkup replyMarkup = new TdApi.ReplyMarkupInlineKeyboard(new TdApi.InlineKeyboardButton[][] { row, row, row });

TdApi.InputMessageContent content = new TdApi.InputMessageText(new TdApi.FormattedText(message, null), false, true);
_client.Send(new TdApi.SendMessage(chatId, 0, 0, null, replyMarkup, content), _defaultHandler);
_client.Send(new TdApi.SendMessage(chatId, 0, null, null, replyMarkup, content), _defaultHandler);
}

static void Main()
Expand Down
Loading

0 comments on commit ceee1ad

Please sign in to comment.