Skip to content

Commit

Permalink
Support visionOS in TDLib.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Mar 11, 2024
1 parent 23c7a6c commit 44b42cc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion td/telegram/NotificationSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ unique_ptr<NotificationSound> get_notification_sound(telegram_api::peerNotifySet
telegram_api::NotificationSound *sound =
#if TD_ANDROID
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();
#else
for_stories ? settings->stories_other_sound_.get() : settings->other_sound_.get();
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/SecretChatsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void SecretChatsManager::on_update_chat(tl_object_ptr<telegram_api::updateEncryp
PendingChatUpdate pending_update;
pending_update.online_process_time_ = Timestamp::now();
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);
#else
pending_update.online_process_time_ = Timestamp::in(2.0);
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/net/ConnectionCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ConnectionCreator final : public NetQueryCallback {

struct ClientInfo {
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;
#else
static constexpr int32 MAX_BACKOFF = 16;
Expand Down
2 changes: 2 additions & 0 deletions tdutils/td/utils/port/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define TD_DARWIN_IOS 1
#elif TARGET_OS_TV
#define TD_DARWIN_TV_OS 1
#elif TARGET_OS_VISION
#define TD_DARWIN_VISION_OS 1
#elif TARGET_OS_WATCH
#define TD_DARWIN_WATCH_OS 1
#else
Expand Down
2 changes: 2 additions & 0 deletions tdutils/td/utils/port/uname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Slice get_operating_system_version() {
return "iOS" + os_version;
#elif TD_DARWIN_TV_OS
return "tvOS" + os_version;
#elif TD_DARWIN_VISIOM_OS
return "visionOS" + os_version;
#elif TD_DARWIN_WATCH_OS
return "watchOS" + os_version;
#elif TD_DARWIN_MAC
Expand Down

0 comments on commit 44b42cc

Please sign in to comment.