From bcfbdcd6eda0a35b2235ca0debd40df0b05ba5a4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 10 Jun 2022 17:38:52 +0400 Subject: [PATCH] Fix build on macOS. --- Telegram/SourceFiles/boxes/premium_preview_box.cpp | 2 +- .../SourceFiles/inline_bots/bot_attach_web_view.cpp | 10 +++++----- Telegram/SourceFiles/inline_bots/bot_attach_web_view.h | 2 +- .../SourceFiles/window/window_session_controller.cpp | 2 +- Telegram/build/updates.py | 8 ++++---- Telegram/build/updates.sh | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/boxes/premium_preview_box.cpp b/Telegram/SourceFiles/boxes/premium_preview_box.cpp index 99effaee0..622bf4a44 100644 --- a/Telegram/SourceFiles/boxes/premium_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/premium_preview_box.cpp @@ -422,7 +422,7 @@ void PreloadSticker(const std::shared_ptr &media) { } const auto width = st::premiumVideoWidth; const auto height = state->blurred.height() - ? state->blurred.height() + ? (state->blurred.height() / state->blurred.devicePixelRatio()) : width; const auto left = (st::boxWideWidth - width) / 2; const auto top = st::premiumPreviewHeight - height; diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index 33f2c5ce9..7d7c73b79 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -373,16 +373,16 @@ bool PeerMatchesTypes( return (types & PeerType::Group); } -PeerTypes ParseChooseTypes(const QString &choose) { +PeerTypes ParseChooseTypes(QStringView choose) { auto result = PeerTypes(); for (const auto &entry : choose.split(QChar(' '))) { - if (entry == "users") { + if (entry == u"users"_q) { result |= PeerType::User; - } else if (entry == "bots") { + } else if (entry == u"bots"_q) { result |= PeerType::Bot; - } else if (entry == "groups") { + } else if (entry == u"groups"_q) { result |= PeerType::Group; - } else if (entry == "channels") { + } else if (entry == u"channels"_q) { result |= PeerType::Broadcast; } } diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h index 6f9a0f36c..138c49360 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.h @@ -47,7 +47,7 @@ using PeerTypes = base::flags; not_null peer, not_null bot, PeerTypes types); -[[nodiscard]] PeerTypes ParseChooseTypes(const QString &choose); +[[nodiscard]] PeerTypes ParseChooseTypes(QStringView choose); struct AttachWebViewBot { not_null user; diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index b084c998a..1bf10a7d7 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -843,7 +843,7 @@ void SessionController::setupPremiumToast() { Ui::Toast::Show( Window::Show(this).toastParent(), { - .text = tr::lng_premium_success(tr::now), + .text = { tr::lng_premium_success(tr::now) }, .st = &st::defaultToast, }); }, _lifetime); diff --git a/Telegram/build/updates.py b/Telegram/build/updates.py index 040a72b6d..3f5cd81a5 100644 --- a/Telegram/build/updates.py +++ b/Telegram/build/updates.py @@ -106,7 +106,7 @@ if building: finish(1, 'Adding tdesktop to archive.') print('Beginning notarization process.') - lines = subprocess.check_output('xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.TelegramDebug" --username "' + username + '" --password "@keychain:AC_PASSWORD" --file "' + archive + '"', stderr=subprocess.STDOUT, shell=True) + lines = subprocess.check_output('xcrun altool --notarize-app --primary-bundle-id "com.tdesktop.TelegramDebug" --username "' + username + '" --password "@keychain:AC_PASSWORD" --file "' + archive + '"', stderr=subprocess.STDOUT, shell=True).decode('utf-8') print('Response received.') uuid = '' for line in lines.split('\n'): @@ -124,7 +124,7 @@ if building: while requestStatus == '': time.sleep(5) print('Checking...') - lines = subprocess.check_output('xcrun altool --notarization-info "' + uuid + '" --username "' + username + '" --password "@keychain:AC_PASSWORD"', stderr=subprocess.STDOUT, shell=True) + lines = subprocess.check_output('xcrun altool --notarization-info "' + uuid + '" --username "' + username + '" --password "@keychain:AC_PASSWORD"', stderr=subprocess.STDOUT, shell=True).decode('utf-8') statusFound = False for line in lines.split('\n'): parts = line.strip().split(' ') @@ -152,7 +152,7 @@ if building: logLines = '' if logUrl != '': print('Requesting log...') - logLines = subprocess.check_output('curl ' + logUrl, shell=True) + logLines = subprocess.check_output('curl ' + logUrl, shell=True).decode('utf-8') result = subprocess.call('xcrun stapler staple Telegram.app', shell=True) if result != 0: finish(1, 'Error calling stapler') @@ -203,7 +203,7 @@ if composing: if not re.match(r'^[a-f0-9]{9,40}$', lastCommit): finish(1, 'Wrong last commit: ' + lastCommit) - log = subprocess.check_output(['git', 'log', lastCommit+'..HEAD']) + log = subprocess.check_output(['git', 'log', lastCommit+'..HEAD']).decode('utf-8') logLines = log.split('\n') firstCommit = '' commits = [] diff --git a/Telegram/build/updates.sh b/Telegram/build/updates.sh index ffb76f1aa..0e00178e0 100755 --- a/Telegram/build/updates.sh +++ b/Telegram/build/updates.sh @@ -17,6 +17,6 @@ pushd `dirname $0` > /dev/null FullScriptPath=`pwd` popd > /dev/null -python $FullScriptPath/updates.py $1 $2 $3 $4 $5 $6 +python3 $FullScriptPath/updates.py $1 $2 $3 $4 $5 $6 exit