Support visionOS in TDLib.

This commit is contained in:
levlam 2024-03-11 22:47:54 +03:00
parent 23c7a6caee
commit 44b42cc659
5 changed files with 7 additions and 3 deletions

View File

@ -256,7 +256,7 @@ unique_ptr<NotificationSound> get_notification_sound(telegram_api::peerNotifySet
telegram_api::NotificationSound *sound = telegram_api::NotificationSound *sound =
#if TD_ANDROID #if TD_ANDROID
for_stories ? settings->stories_android_sound_.get() : settings->android_sound_.get(); for_stories ? settings->stories_android_sound_.get() : settings->android_sound_.get();
#elif TD_DARWIN_IOS || TD_DARWIN_TV_OS || TD_DARWIN_WATCH_OS #elif TD_DARWIN_IOS || TD_DARWIN_TV_OS || TD_DARWIN_VISION_OS || TD_DARWIN_WATCH_OS || TD_DARWIN_UNKNOWN
for_stories ? settings->stories_ios_sound_.get() : settings->ios_sound_.get(); for_stories ? settings->stories_ios_sound_.get() : settings->ios_sound_.get();
#else #else
for_stories ? settings->stories_other_sound_.get() : settings->other_sound_.get(); for_stories ? settings->stories_other_sound_.get() : settings->other_sound_.get();

View File

@ -168,7 +168,7 @@ void SecretChatsManager::on_update_chat(tl_object_ptr<telegram_api::updateEncryp
PendingChatUpdate pending_update; PendingChatUpdate pending_update;
pending_update.online_process_time_ = Timestamp::now(); pending_update.online_process_time_ = Timestamp::now();
if (update->chat_->get_id() == telegram_api::encryptedChatRequested::ID) { if (update->chat_->get_id() == telegram_api::encryptedChatRequested::ID) {
#if TD_ANDROID || TD_DARWIN_IOS || TD_DARWIN_WATCH_OS || TD_TIZEN #if TD_ANDROID || TD_DARWIN_IOS
pending_update.offline_process_time_ = Timestamp::in(1.0); pending_update.offline_process_time_ = Timestamp::in(1.0);
#else #else
pending_update.online_process_time_ = Timestamp::in(2.0); pending_update.online_process_time_ = Timestamp::in(2.0);

View File

@ -119,7 +119,7 @@ class ConnectionCreator final : public NetQueryCallback {
struct ClientInfo { struct ClientInfo {
class Backoff { class Backoff {
#if TD_ANDROID || TD_DARWIN_IOS || TD_DARWIN_WATCH_OS || TD_TIZEN #if TD_ANDROID || TD_DARWIN_IOS || TD_DARWIN_VISION_OS || TD_DARWIN_WATCH_OS || TD_TIZEN
static constexpr int32 MAX_BACKOFF = 300; static constexpr int32 MAX_BACKOFF = 300;
#else #else
static constexpr int32 MAX_BACKOFF = 16; static constexpr int32 MAX_BACKOFF = 16;

View File

@ -25,6 +25,8 @@
#define TD_DARWIN_IOS 1 #define TD_DARWIN_IOS 1
#elif TARGET_OS_TV #elif TARGET_OS_TV
#define TD_DARWIN_TV_OS 1 #define TD_DARWIN_TV_OS 1
#elif TARGET_OS_VISION
#define TD_DARWIN_VISION_OS 1
#elif TARGET_OS_WATCH #elif TARGET_OS_WATCH
#define TD_DARWIN_WATCH_OS 1 #define TD_DARWIN_WATCH_OS 1
#else #else

View File

@ -81,6 +81,8 @@ Slice get_operating_system_version() {
return "iOS" + os_version; return "iOS" + os_version;
#elif TD_DARWIN_TV_OS #elif TD_DARWIN_TV_OS
return "tvOS" + os_version; return "tvOS" + os_version;
#elif TD_DARWIN_VISIOM_OS
return "visionOS" + os_version;
#elif TD_DARWIN_WATCH_OS #elif TD_DARWIN_WATCH_OS
return "watchOS" + os_version; return "watchOS" + os_version;
#elif TD_DARWIN_MAC #elif TD_DARWIN_MAC