mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Merge branch 'beta' into bazel
This commit is contained in:
commit
f15c474757
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@ DerivedData
|
|||||||
*/xcuserdata/*
|
*/xcuserdata/*
|
||||||
buck-out/*
|
buck-out/*
|
||||||
.buckd/*
|
.buckd/*
|
||||||
|
tools/buck
|
||||||
AppBinary.xcworkspace/*
|
AppBinary.xcworkspace/*
|
||||||
Project.xcodeproj/*
|
Project.xcodeproj/*
|
||||||
Watch/Watch.xcodeproj/*
|
Watch/Watch.xcodeproj/*
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
LANG: "en_US.UTF-8"
|
LANG: "en_US.UTF-8"
|
||||||
@ -16,6 +17,7 @@ internal:
|
|||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- bash buildbox/build-telegram.sh hockeyapp
|
- bash buildbox/build-telegram.sh hockeyapp
|
||||||
|
- bash buildbox/deploy-telegram.sh hockeyapp
|
||||||
environment:
|
environment:
|
||||||
name: internal
|
name: internal
|
||||||
|
|
||||||
@ -31,3 +33,20 @@ beta_testflight:
|
|||||||
- bash buildbox/build-telegram.sh appstore
|
- bash buildbox/build-telegram.sh appstore
|
||||||
environment:
|
environment:
|
||||||
name: testflight_llc
|
name: testflight_llc
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/artifacts
|
||||||
|
expire_in: 1 week
|
||||||
|
|
||||||
|
deploy_beta_testflight:
|
||||||
|
tags:
|
||||||
|
- ios_beta
|
||||||
|
stage: deploy
|
||||||
|
only:
|
||||||
|
- beta
|
||||||
|
except:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- bash buildbox/deploy-telegram.sh appstore
|
||||||
|
environment:
|
||||||
|
name: testflight_llc
|
||||||
|
@ -146,7 +146,7 @@ def intents_extension_configs():
|
|||||||
def watch_extension_binary_configs():
|
def watch_extension_binary_configs():
|
||||||
config = {
|
config = {
|
||||||
"SDKROOT": "watchos",
|
"SDKROOT": "watchos",
|
||||||
"WATCHOS_DEPLOYMENT_TARGET": "4.0",
|
"WATCHOS_DEPLOYMENT_TARGET": "5.0",
|
||||||
"TARGETED_DEVICE_FAMILY": "4",
|
"TARGETED_DEVICE_FAMILY": "4",
|
||||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp.watchkitextension"),
|
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp.watchkitextension"),
|
||||||
"DEVELOPMENT_TEAM": get_development_team(),
|
"DEVELOPMENT_TEAM": get_development_team(),
|
||||||
@ -168,7 +168,7 @@ def watch_extension_binary_configs():
|
|||||||
def watch_binary_configs():
|
def watch_binary_configs():
|
||||||
config = {
|
config = {
|
||||||
"SDKROOT": "watchos",
|
"SDKROOT": "watchos",
|
||||||
"WATCHOS_DEPLOYMENT_TARGET": "4.0",
|
"WATCHOS_DEPLOYMENT_TARGET": "5.0",
|
||||||
"TARGETED_DEVICE_FAMILY": "4",
|
"TARGETED_DEVICE_FAMILY": "4",
|
||||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp"),
|
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp"),
|
||||||
"DEVELOPMENT_TEAM": get_development_team(),
|
"DEVELOPMENT_TEAM": get_development_team(),
|
||||||
|
@ -226,15 +226,18 @@ static void reportMemory() {
|
|||||||
silent = [silentString intValue] != 0;
|
silent = [silentString intValue] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *attachmentDataString = decryptedPayload[@"attachb64"];
|
|
||||||
NSData *attachmentData = nil;
|
NSData *attachmentData = nil;
|
||||||
id parsedAttachment = nil;
|
id parsedAttachment = nil;
|
||||||
|
|
||||||
|
if (_isLockedValue) {
|
||||||
|
NSString *attachmentDataString = decryptedPayload[@"attachb64"];
|
||||||
if ([attachmentDataString isKindOfClass:[NSString class]]) {
|
if ([attachmentDataString isKindOfClass:[NSString class]]) {
|
||||||
attachmentData = parseBase64(attachmentDataString);
|
attachmentData = parseBase64(attachmentDataString);
|
||||||
if (attachmentData != nil) {
|
if (attachmentData != nil) {
|
||||||
parsedAttachment = parseAttachment(attachmentData);
|
parsedAttachment = parseAttachment(attachmentData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSString *imagesPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"aps-data"];
|
NSString *imagesPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"aps-data"];
|
||||||
[[NSFileManager defaultManager] createDirectoryAtPath:imagesPath withIntermediateDirectories:true attributes:nil error:nil];
|
[[NSFileManager defaultManager] createDirectoryAtPath:imagesPath withIntermediateDirectories:true attributes:nil error:nil];
|
||||||
@ -324,6 +327,7 @@ static void reportMemory() {
|
|||||||
}
|
}
|
||||||
_bestAttemptContent.title = title;
|
_bestAttemptContent.title = title;
|
||||||
if (_isLockedValue) {
|
if (_isLockedValue) {
|
||||||
|
_bestAttemptContent.title = @"";
|
||||||
_bestAttemptContent.subtitle = @"";
|
_bestAttemptContent.subtitle = @"";
|
||||||
if (_lockedMessageTextValue != nil) {
|
if (_lockedMessageTextValue != nil) {
|
||||||
_bestAttemptContent.body = _lockedMessageTextValue;
|
_bestAttemptContent.body = _lockedMessageTextValue;
|
||||||
@ -348,14 +352,21 @@ static void reportMemory() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_isLockedValue) {
|
||||||
|
_bestAttemptContent.threadIdentifier = @"locked";
|
||||||
|
} else {
|
||||||
NSString *threadIdString = aps[@"thread-id"];
|
NSString *threadIdString = aps[@"thread-id"];
|
||||||
if ([threadIdString isKindOfClass:[NSString class]]) {
|
if ([threadIdString isKindOfClass:[NSString class]]) {
|
||||||
_bestAttemptContent.threadIdentifier = threadIdString;
|
_bestAttemptContent.threadIdentifier = threadIdString;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
NSString *soundString = aps[@"sound"];
|
NSString *soundString = aps[@"sound"];
|
||||||
if ([soundString isKindOfClass:[NSString class]]) {
|
if ([soundString isKindOfClass:[NSString class]]) {
|
||||||
_bestAttemptContent.sound = [UNNotificationSound soundNamed:soundString];
|
_bestAttemptContent.sound = [UNNotificationSound soundNamed:soundString];
|
||||||
}
|
}
|
||||||
|
if (_isLockedValue) {
|
||||||
|
_bestAttemptContent.categoryIdentifier = @"locked";
|
||||||
|
} else {
|
||||||
NSString *categoryString = aps[@"category"];
|
NSString *categoryString = aps[@"category"];
|
||||||
if ([categoryString isKindOfClass:[NSString class]]) {
|
if ([categoryString isKindOfClass:[NSString class]]) {
|
||||||
_bestAttemptContent.categoryIdentifier = categoryString;
|
_bestAttemptContent.categoryIdentifier = categoryString;
|
||||||
@ -382,6 +393,7 @@ static void reportMemory() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_bestAttemptContent.userInfo = userInfo;
|
_bestAttemptContent.userInfo = userInfo;
|
||||||
|
|
||||||
|
@ -6,6 +6,16 @@ import BuildConfig
|
|||||||
class ShareRootController: UIViewController {
|
class ShareRootController: UIViewController {
|
||||||
private var impl: ShareRootControllerImpl?
|
private var impl: ShareRootControllerImpl?
|
||||||
|
|
||||||
|
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||||
|
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||||
|
|
||||||
|
self.modalPresentationStyle = .fullScreen
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
override func loadView() {
|
override func loadView() {
|
||||||
super.loadView()
|
super.loadView()
|
||||||
|
|
||||||
|
@ -5065,3 +5065,5 @@ Any member of this group will be able to see messages in the channel.";
|
|||||||
"WebBrowser.InAppSafari" = "In-App Safari";
|
"WebBrowser.InAppSafari" = "In-App Safari";
|
||||||
|
|
||||||
"Widget.ApplicationLocked" = "Unlock the app to use the widget";
|
"Widget.ApplicationLocked" = "Unlock the app to use the widget";
|
||||||
|
|
||||||
|
"Group.ErrorSupergroupConversionNotPossible" = "Sorry, you are a member of too many groups and channels. Please leave some before creating a new one.";
|
||||||
|
@ -117,7 +117,14 @@ final class PeerView: UIView {
|
|||||||
|
|
||||||
private let tapped: () -> Void
|
private let tapped: () -> Void
|
||||||
|
|
||||||
|
var primaryColor: UIColor {
|
||||||
|
didSet {
|
||||||
|
self.titleLabel.textColor = self.primaryColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
init(primaryColor: UIColor, accountPeerId: Int64, peer: WidgetDataPeer, tapped: @escaping () -> Void) {
|
init(primaryColor: UIColor, accountPeerId: Int64, peer: WidgetDataPeer, tapped: @escaping () -> Void) {
|
||||||
|
self.primaryColor = primaryColor
|
||||||
self.peer = peer
|
self.peer = peer
|
||||||
self.tapped = tapped
|
self.tapped = tapped
|
||||||
self.avatarView = AvatarView(accountPeerId: accountPeerId, peer: peer, size: avatarSize)
|
self.avatarView = AvatarView(accountPeerId: accountPeerId, peer: peer, size: avatarSize)
|
||||||
|
@ -77,6 +77,21 @@ class TodayViewController: UIViewController, NCWidgetProviding {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||||
|
if #available(iOSApplicationExtension 13.0, *) {
|
||||||
|
switch self.traitCollection.userInterfaceStyle {
|
||||||
|
case .dark:
|
||||||
|
self.primaryColor = .white
|
||||||
|
default:
|
||||||
|
self.primaryColor = .black
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.appLockedLabel?.textColor = self.primaryColor
|
||||||
|
for view in self.peerViews {
|
||||||
|
view.primaryColor = self.primaryColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) {
|
func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) {
|
||||||
completionHandler(.newData)
|
completionHandler(.newData)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ set -e
|
|||||||
BUILD_TELEGRAM_VERSION="1"
|
BUILD_TELEGRAM_VERSION="1"
|
||||||
|
|
||||||
MACOS_VERSION="10.15"
|
MACOS_VERSION="10.15"
|
||||||
XCODE_VERSION="11.1"
|
XCODE_VERSION="11.2"
|
||||||
GUEST_SHELL="bash"
|
GUEST_SHELL="bash"
|
||||||
|
|
||||||
VM_BASE_NAME="macos$(echo $MACOS_VERSION | sed -e 's/\.'/_/g)_Xcode$(echo $XCODE_VERSION | sed -e 's/\.'/_/g)"
|
VM_BASE_NAME="macos$(echo $MACOS_VERSION | sed -e 's/\.'/_/g)_Xcode$(echo $XCODE_VERSION | sed -e 's/\.'/_/g)"
|
||||||
@ -150,15 +150,24 @@ if [ "$BUILD_MACHINE" == "linux" ]; then
|
|||||||
done
|
done
|
||||||
elif [ "$BUILD_MACHINE" == "macOS" ]; then
|
elif [ "$BUILD_MACHINE" == "macOS" ]; then
|
||||||
if [ -z "$RUNNING_VM" ]; then
|
if [ -z "$RUNNING_VM" ]; then
|
||||||
SNAPSHOT_ID=$(prlctl snapshot-list "$VM_BASE_NAME" | grep -Eo '\{(\d|[a-f]|-)*\}' | tr '\n' '\0')
|
prlctl clone "$VM_BASE_NAME" --linked --name "$VM_NAME"
|
||||||
if [ -z "$SNAPSHOT_ID" ]; then
|
prlctl start "$VM_NAME"
|
||||||
echo "$VM_BASE_NAME is required to have one snapshot"
|
|
||||||
exit 1
|
echo "Getting VM IP"
|
||||||
|
|
||||||
|
while [ 1 ]; do
|
||||||
|
TEST_IP=$(prlctl exec "$VM_NAME" "ifconfig | grep inet | grep broadcast | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1 | tr '\n' '\0'" || echo "")
|
||||||
|
if [ ! -z "$TEST_IP" ]; then
|
||||||
|
RESPONSE=$(ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$TEST_IP" -o ServerAliveInterval=60 -t "echo -n 1")
|
||||||
|
if [ "$RESPONSE" == "1" ]; then
|
||||||
|
VM_IP="$TEST_IP"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
prlctl clone "$VM_BASE_NAME" --name "$VM_NAME"
|
|
||||||
prlctl snapshot-switch "$VM_NAME" -i "$SNAPSHOT_ID"
|
|
||||||
fi
|
fi
|
||||||
VM_IP=$(prlctl exec "$VM_NAME" "ifconfig | grep inet | grep broadcast | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1 | tr '\n' '\0'")
|
sleep 1
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo "VM_IP=$VM_IP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr "$BUILDBOX_DIR/$CODESIGNING_SUBPATH" telegram@"$VM_IP":codesigning_data
|
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr "$BUILDBOX_DIR/$CODESIGNING_SUBPATH" telegram@"$VM_IP":codesigning_data
|
||||||
@ -173,24 +182,11 @@ scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/nul
|
|||||||
|
|
||||||
ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$VM_IP" -o ServerAliveInterval=60 -t "export TELEGRAM_BUILD_APPSTORE_PASSWORD=\"$TELEGRAM_BUILD_APPSTORE_PASSWORD\"; export TELEGRAM_BUILD_APPSTORE_TEAM_NAME=\"$TELEGRAM_BUILD_APPSTORE_TEAM_NAME\"; export TELEGRAM_BUILD_APPSTORE_USERNAME=\"$TELEGRAM_BUILD_APPSTORE_USERNAME\"; export BUILD_NUMBER=\"$BUILD_NUMBER\"; export COMMIT_ID=\"$COMMIT_ID\"; export COMMIT_AUTHOR=\"$COMMIT_AUTHOR\"; export BUCK_HTTP_CACHE=\"$BUCK_HTTP_CACHE\"; $GUEST_SHELL -l guest-build-telegram.sh $BUILD_CONFIGURATION" || true
|
ssh -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null telegram@"$VM_IP" -o ServerAliveInterval=60 -t "export TELEGRAM_BUILD_APPSTORE_PASSWORD=\"$TELEGRAM_BUILD_APPSTORE_PASSWORD\"; export TELEGRAM_BUILD_APPSTORE_TEAM_NAME=\"$TELEGRAM_BUILD_APPSTORE_TEAM_NAME\"; export TELEGRAM_BUILD_APPSTORE_USERNAME=\"$TELEGRAM_BUILD_APPSTORE_USERNAME\"; export BUILD_NUMBER=\"$BUILD_NUMBER\"; export COMMIT_ID=\"$COMMIT_ID\"; export COMMIT_AUTHOR=\"$COMMIT_AUTHOR\"; export BUCK_HTTP_CACHE=\"$BUCK_HTTP_CACHE\"; $GUEST_SHELL -l guest-build-telegram.sh $BUILD_CONFIGURATION" || true
|
||||||
|
|
||||||
if [ "$BUILD_CONFIGURATION" == "appstore" ]; then
|
OUTPUT_PATH="build/artifacts"
|
||||||
ARCHIVE_PATH="$HOME/telegram-builds-archive"
|
rm -rf "$OUTPUT_PATH"
|
||||||
DATE_PATH=$(date +%Y-%m-%d_%H-%M-%S)
|
mkdir -p "$OUTPUT_PATH"
|
||||||
ARCHIVE_BUILD_PATH="$ARCHIVE_PATH/$DATE_PATH"
|
|
||||||
mkdir -p "$ARCHIVE_PATH"
|
|
||||||
mkdir -p "$ARCHIVE_BUILD_PATH"
|
|
||||||
APPSTORE_IPA="Telegram-iOS-AppStoreLLC.ipa"
|
|
||||||
APPSTORE_DSYM_ZIP="Telegram-iOS-AppStoreLLC.app.dSYM.zip"
|
|
||||||
APPSTORE_TARGET_IPA="$ARCHIVE_BUILD_PATH/Telegram-iOS-AppStoreLLC.ipa"
|
|
||||||
APPSTORE_TARGET_DSYM_ZIP="$ARCHIVE_BUILD_PATH/Telegram-iOS-AppStoreLLC.app.dSYM.zip"
|
|
||||||
|
|
||||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr telegram@"$VM_IP":"telegram-ios/*.ipa" "$ARCHIVE_BUILD_PATH/"
|
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr telegram@"$VM_IP":"telegram-ios/build/artifacts/*" "$OUTPUT_PATH/"
|
||||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr telegram@"$VM_IP":"telegram-ios/*.zip" "$ARCHIVE_BUILD_PATH/"
|
|
||||||
elif [ "$BUILD_CONFIGURATION" == "verify" ]; then
|
|
||||||
VERIFY_IPA="Telegram-Verify-Build.ipa"
|
|
||||||
rm -f "$VERIFY_IPA"
|
|
||||||
scp -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr telegram@"$VM_IP":telegram-ios/Telegram-iOS-AppStoreLLC.ipa "./$VERIFY_IPA"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$RUNNING_VM" ]; then
|
if [ -z "$RUNNING_VM" ]; then
|
||||||
if [ "$BUILD_MACHINE" == "linux" ]; then
|
if [ "$BUILD_MACHINE" == "linux" ]; then
|
||||||
@ -201,3 +197,7 @@ if [ -z "$RUNNING_VM" ]; then
|
|||||||
prlctl delete "$VM_NAME"
|
prlctl delete "$VM_NAME"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$OUTPUT_PATH/Telegram.ipa" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
68
buildbox/deploy-telegram.sh
Normal file
68
buildbox/deploy-telegram.sh
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
CONFIGURATION="$1"
|
||||||
|
|
||||||
|
if [ -z "$CONFIGURATION" ]; then
|
||||||
|
echo "Usage: sh deploy-telegram.sh CONFIGURATION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! `which setup-telegram-build.sh` ]; then
|
||||||
|
echo "setup-telegram-build.sh not found in PATH $PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BASE_DIR=$(pwd)
|
||||||
|
BUILDBOX_DIR="buildbox"
|
||||||
|
mkdir -p "$BUILDBOX_DIR/transient-data"
|
||||||
|
|
||||||
|
source `which setup-telegram-build.sh`
|
||||||
|
setup_telegram_build "$CONFIGURATION" "$BASE_DIR/$BUILDBOX_DIR/transient-data"
|
||||||
|
|
||||||
|
COMMIT_ID=$(git rev-parse HEAD)
|
||||||
|
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')
|
||||||
|
if [ -z "$2" ]; then
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
COMMIT_COUNT="$(($COMMIT_COUNT+1000))"
|
||||||
|
BUILD_NUMBER="$COMMIT_COUNT"
|
||||||
|
else
|
||||||
|
BUILD_NUMBER="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CONFIGURATION" == "hockeyapp" ]; then
|
||||||
|
FASTLANE_PASSWORD=""
|
||||||
|
FASTLANE_ITC_TEAM_NAME=""
|
||||||
|
FASTLANE_BUILD_CONFIGURATION="internalhockeyapp"
|
||||||
|
elif [ "$CONFIGURATION" == "appstore" ]; then
|
||||||
|
FASTLANE_PASSWORD="$TELEGRAM_BUILD_APPSTORE_PASSWORD"
|
||||||
|
FASTLANE_ITC_TEAM_NAME="$TELEGRAM_BUILD_APPSTORE_TEAM_NAME"
|
||||||
|
FASTLANE_ITC_USERNAME="$TELEGRAM_BUILD_APPSTORE_USERNAME"
|
||||||
|
FASTLANE_BUILD_CONFIGURATION="testflight_llc"
|
||||||
|
else
|
||||||
|
echo "Unknown configuration $CONFIGURATION"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
OUTPUT_PATH="build/artifacts"
|
||||||
|
IPA_PATH="$OUTPUT_PATH/Telegram.ipa"
|
||||||
|
DSYM_PATH="$OUTPUT_PATH/Telegram.DSYMs.zip"
|
||||||
|
|
||||||
|
if [ ! -f "$IPA_PATH" ]; then
|
||||||
|
echo "$IPA_PATH not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$DSYM_PATH" ]; then
|
||||||
|
echo "$DSYM_PATH not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "appstore" ]; then
|
||||||
|
export DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="-t DAV"
|
||||||
|
FASTLANE_PASSWORD="$FASTLANE_PASSWORD" xcrun altool --upload-app --type ios --file "$IPA_PATH" --username "$FASTLANE_ITC_USERNAME" --password "@env:FASTLANE_PASSWORD"
|
||||||
|
#FASTLANE_PASSWORD="$FASTLANE_PASSWORD" FASTLANE_ITC_TEAM_NAME="$FASTLANE_ITC_TEAM_NAME" fastlane "$FASTLANE_BUILD_CONFIGURATION" build_number:"$BUILD_NUMBER" commit_hash:"$COMMIT_ID" commit_author:"$COMMIT_AUTHOR" skip_build:1 skip_pilot:1
|
||||||
|
else
|
||||||
|
FASTLANE_PASSWORD="$FASTLANE_PASSWORD" FASTLANE_ITC_TEAM_NAME="$FASTLANE_ITC_TEAM_NAME" fastlane "$FASTLANE_BUILD_CONFIGURATION" build_number:"$BUILD_NUMBER" commit_hash:"$COMMIT_ID" commit_author:"$COMMIT_AUTHOR" skip_build:1
|
||||||
|
fi
|
@ -108,14 +108,10 @@ else
|
|||||||
|
|
||||||
if [ "$1" == "hockeyapp" ]; then
|
if [ "$1" == "hockeyapp" ]; then
|
||||||
BUILD_ENV_SCRIPT="internal"
|
BUILD_ENV_SCRIPT="internal"
|
||||||
RESULT_IPA_NAME="Telegram-iOS-Hockeyapp-Internal.ipa"
|
|
||||||
RESULT_DSYM_NAME="Telegram-iOS-Hockeyapp-Internal.app.dSYM.zip"
|
|
||||||
FASTLANE_BUILD_CONFIGURATION="internalhockeyapp"
|
FASTLANE_BUILD_CONFIGURATION="internalhockeyapp"
|
||||||
APP_TARGET="app_arm64"
|
APP_TARGET="app_arm64"
|
||||||
elif [ "$1" == "appstore" ]; then
|
elif [ "$1" == "appstore" ]; then
|
||||||
BUILD_ENV_SCRIPT="appstore"
|
BUILD_ENV_SCRIPT="appstore"
|
||||||
RESULT_IPA_NAME="Telegram-iOS-AppStoreLLC.ipa"
|
|
||||||
RESULT_DSYM_NAME="Telegram-iOS-AppStoreLLC.app.dSYM.zip"
|
|
||||||
FASTLANE_BUILD_CONFIGURATION="testflight_llc"
|
FASTLANE_BUILD_CONFIGURATION="testflight_llc"
|
||||||
APP_TARGET="app"
|
APP_TARGET="app"
|
||||||
else
|
else
|
||||||
@ -124,16 +120,13 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
BUCK="$(pwd)/tools/buck" BUCK_HTTP_CACHE="$BUCK_HTTP_CACHE" LOCAL_CODESIGNING=1 sh "../telegram-ios-shared/buildbox/bin/$BUILD_ENV_SCRIPT.sh" make "$APP_TARGET"
|
BUCK="$(pwd)/tools/buck" BUCK_HTTP_CACHE="$BUCK_HTTP_CACHE" LOCAL_CODESIGNING=1 sh "../telegram-ios-shared/buildbox/bin/$BUILD_ENV_SCRIPT.sh" make "$APP_TARGET"
|
||||||
cp "build/Telegram_signed.ipa" "./$RESULT_IPA_NAME"
|
|
||||||
cp "build/DSYMs.zip" "./$RESULT_DSYM_NAME"
|
|
||||||
|
|
||||||
export DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS="-t DAV"
|
OUTPUT_PATH="build/artifacts"
|
||||||
if [ "$1" == "appstore" ]; then
|
rm -rf "$OUTPUT_PATH"
|
||||||
FASTLANE_PASSWORD="$FASTLANE_PASSWORD" xcrun altool --upload-app --type ios --file "$RESULT_IPA_NAME" --username "$FASTLANE_ITC_USERNAME" --password "@env:FASTLANE_PASSWORD"
|
mkdir -p "$OUTPUT_PATH"
|
||||||
FASTLANE_PASSWORD="$FASTLANE_PASSWORD" FASTLANE_ITC_TEAM_NAME="$FASTLANE_ITC_TEAM_NAME" fastlane "$FASTLANE_BUILD_CONFIGURATION" build_number:"$BUILD_NUMBER" commit_hash:"$COMMIT_ID" commit_author:"$COMMIT_AUTHOR" skip_build:1 skip_pilot:1
|
|
||||||
else
|
cp "build/Telegram_signed.ipa" "./$OUTPUT_PATH/Telegram.ipa"
|
||||||
FASTLANE_PASSWORD="$FASTLANE_PASSWORD" FASTLANE_ITC_TEAM_NAME="$FASTLANE_ITC_TEAM_NAME" fastlane "$FASTLANE_BUILD_CONFIGURATION" build_number:"$BUILD_NUMBER" commit_hash:"$COMMIT_ID" commit_author:"$COMMIT_AUTHOR" skip_build:1
|
cp "build/DSYMs.zip" "./$OUTPUT_PATH/Telegram.DSYMs.zip"
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$BASE_DIR"
|
cd "$BASE_DIR"
|
||||||
fi
|
fi
|
||||||
|
@ -73,7 +73,7 @@ with open(destination + '/BUCK', 'w+b') as file:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
shutil.copytree('Config', destination + '/' + 'Config')
|
shutil.copytree('Config', destination + '/' + 'Config')
|
||||||
shutil.copytree('tools/buck', destination + '/' + 'tools/buck')
|
shutil.copytree('tools/buck-build', destination + '/' + 'tools/buck-build')
|
||||||
|
|
||||||
shutil.copy('Wallet/README.md', destination + '/' + 'README.md')
|
shutil.copy('Wallet/README.md', destination + '/' + 'README.md')
|
||||||
os.remove(destination + '/Wallet/' + 'README.md')
|
os.remove(destination + '/Wallet/' + 'README.md')
|
||||||
|
@ -60,6 +60,6 @@ lane :build_for_appstore do |options|
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if File.exists?("../../Telegram-iOS-Shared/fastlane/Fastfile")
|
if File.exists?("../buildbox/transient-data/telegram-ios-shared/fastlane/Fastfile")
|
||||||
import "../../Telegram-iOS-Shared/fastlane/Fastfile"
|
import "../buildbox/transient-data/telegram-ios-shared/fastlane/Fastfile"
|
||||||
end
|
end
|
||||||
|
@ -17,12 +17,12 @@ private func isLocked(passcodeSettings: PresentationPasscodeSettings, state: Loc
|
|||||||
} else if let autolockTimeout = passcodeSettings.autolockTimeout {
|
} else if let autolockTimeout = passcodeSettings.autolockTimeout {
|
||||||
var bootTimestamp: Int32 = 0
|
var bootTimestamp: Int32 = 0
|
||||||
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
||||||
let timestamp = MonotonicTimestamp(bootTimestap: bootTimestamp, uptime: uptime)
|
let timestamp = MonotonicTimestamp(bootTimestamp: bootTimestamp, uptime: uptime)
|
||||||
|
|
||||||
let applicationActivityTimestamp = state.applicationActivityTimestamp
|
let applicationActivityTimestamp = state.applicationActivityTimestamp
|
||||||
|
|
||||||
if let applicationActivityTimestamp = applicationActivityTimestamp {
|
if let applicationActivityTimestamp = applicationActivityTimestamp {
|
||||||
if timestamp.bootTimestap != applicationActivityTimestamp.bootTimestap {
|
if timestamp.bootTimestamp != applicationActivityTimestamp.bootTimestamp {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if timestamp.uptime >= applicationActivityTimestamp.uptime + autolockTimeout {
|
if timestamp.uptime >= applicationActivityTimestamp.uptime + autolockTimeout {
|
||||||
@ -249,7 +249,7 @@ public final class AppLockContextImpl: AppLockContext {
|
|||||||
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
||||||
|
|
||||||
var state = state
|
var state = state
|
||||||
state.applicationActivityTimestamp = MonotonicTimestamp(bootTimestap: bootTimestamp, uptime: uptime)
|
state.applicationActivityTimestamp = MonotonicTimestamp(bootTimestamp: bootTimestamp, uptime: uptime)
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ public final class AppLockContextImpl: AppLockContext {
|
|||||||
return self.currentState.get()
|
return self.currentState.get()
|
||||||
|> map { state in
|
|> map { state in
|
||||||
return state.unlockAttemts.flatMap { unlockAttemts in
|
return state.unlockAttemts.flatMap { unlockAttemts in
|
||||||
return AccessChallengeAttempts(count: unlockAttemts.count, timestamp: unlockAttemts.wallClockTimestamp)
|
return AccessChallengeAttempts(count: unlockAttemts.count, bootTimestamp: unlockAttemts.timestamp.bootTimestamp, uptime: unlockAttemts.timestamp.uptime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ public final class AppLockContextImpl: AppLockContext {
|
|||||||
|
|
||||||
var bootTimestamp: Int32 = 0
|
var bootTimestamp: Int32 = 0
|
||||||
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
||||||
let timestamp = MonotonicTimestamp(bootTimestap: bootTimestamp, uptime: uptime)
|
let timestamp = MonotonicTimestamp(bootTimestamp: bootTimestamp, uptime: uptime)
|
||||||
state.applicationActivityTimestamp = timestamp
|
state.applicationActivityTimestamp = timestamp
|
||||||
|
|
||||||
return state
|
return state
|
||||||
@ -309,9 +309,15 @@ public final class AppLockContextImpl: AppLockContext {
|
|||||||
public func failedUnlockAttempt() {
|
public func failedUnlockAttempt() {
|
||||||
self.updateLockState { state in
|
self.updateLockState { state in
|
||||||
var state = state
|
var state = state
|
||||||
var unlockAttemts = state.unlockAttemts ?? UnlockAttempts(count: 0, wallClockTimestamp: 0)
|
var unlockAttemts = state.unlockAttemts ?? UnlockAttempts(count: 0, timestamp: MonotonicTimestamp(bootTimestamp: 0, uptime: 0))
|
||||||
|
|
||||||
unlockAttemts.count += 1
|
unlockAttemts.count += 1
|
||||||
unlockAttemts.wallClockTimestamp = Int32(CFAbsoluteTimeGetCurrent())
|
|
||||||
|
var bootTimestamp: Int32 = 0
|
||||||
|
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
||||||
|
let timestamp = MonotonicTimestamp(bootTimestamp: bootTimestamp, uptime: uptime)
|
||||||
|
|
||||||
|
unlockAttemts.timestamp = timestamp
|
||||||
state.unlockAttemts = unlockAttemts
|
state.unlockAttemts = unlockAttemts
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
@ -2,22 +2,22 @@ import Foundation
|
|||||||
import MonotonicTime
|
import MonotonicTime
|
||||||
|
|
||||||
public struct MonotonicTimestamp: Codable, Equatable {
|
public struct MonotonicTimestamp: Codable, Equatable {
|
||||||
public var bootTimestap: Int32
|
public var bootTimestamp: Int32
|
||||||
public var uptime: Int32
|
public var uptime: Int32
|
||||||
|
|
||||||
public init(bootTimestap: Int32, uptime: Int32) {
|
public init(bootTimestamp: Int32, uptime: Int32) {
|
||||||
self.bootTimestap = bootTimestap
|
self.bootTimestamp = bootTimestamp
|
||||||
self.uptime = uptime
|
self.uptime = uptime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct UnlockAttempts: Codable, Equatable {
|
public struct UnlockAttempts: Codable, Equatable {
|
||||||
public var count: Int32
|
public var count: Int32
|
||||||
public var wallClockTimestamp: Int32
|
public var timestamp: MonotonicTimestamp
|
||||||
|
|
||||||
public init(count: Int32, wallClockTimestamp: Int32) {
|
public init(count: Int32, timestamp: MonotonicTimestamp) {
|
||||||
self.count = count
|
self.count = count
|
||||||
self.wallClockTimestamp = wallClockTimestamp
|
self.timestamp = timestamp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ public func isAppLocked(state: LockState) -> Bool {
|
|||||||
} else if let autolockTimeout = state.autolockTimeout {
|
} else if let autolockTimeout = state.autolockTimeout {
|
||||||
var bootTimestamp: Int32 = 0
|
var bootTimestamp: Int32 = 0
|
||||||
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
let uptime = getDeviceUptimeSeconds(&bootTimestamp)
|
||||||
let timestamp = MonotonicTimestamp(bootTimestap: bootTimestamp, uptime: uptime)
|
let timestamp = MonotonicTimestamp(bootTimestamp: bootTimestamp, uptime: uptime)
|
||||||
|
|
||||||
if let applicationActivityTimestamp = state.applicationActivityTimestamp {
|
if let applicationActivityTimestamp = state.applicationActivityTimestamp {
|
||||||
if timestamp.bootTimestap != applicationActivityTimestamp.bootTimestap {
|
if timestamp.bootTimestamp != applicationActivityTimestamp.bootTimestamp {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if timestamp.uptime >= applicationActivityTimestamp.uptime + autolockTimeout {
|
if timestamp.uptime >= applicationActivityTimestamp.uptime + autolockTimeout {
|
||||||
|
@ -71,6 +71,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
|
//! @abstract The range of text currently selected. If length is zero, the range is the cursor location.
|
||||||
@property NSRange selectedRange;
|
@property NSRange selectedRange;
|
||||||
|
|
||||||
|
@property (readonly) CGRect selectionRect;
|
||||||
|
|
||||||
#pragma mark - Placeholder
|
#pragma mark - Placeholder
|
||||||
/**
|
/**
|
||||||
@abstract Indicates if the receiver is displaying the placeholder text.
|
@abstract Indicates if the receiver is displaying the placeholder text.
|
||||||
|
@ -566,6 +566,15 @@
|
|||||||
_textKitComponents.textView.selectedRange = selectedRange;
|
_textKitComponents.textView.selectedRange = selectedRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (CGRect)selectionRect {
|
||||||
|
UITextRange *range = [_textKitComponents.textView selectedTextRange];
|
||||||
|
if (range != nil) {
|
||||||
|
return [_textKitComponents.textView firstRectForRange:range];
|
||||||
|
} else {
|
||||||
|
return [_textKitComponents.textView bounds];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Placeholder
|
#pragma mark - Placeholder
|
||||||
- (BOOL)isDisplayingPlaceholder
|
- (BOOL)isDisplayingPlaceholder
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ class BotCheckoutHeaderItemNode: ListViewItemNode {
|
|||||||
var imageApply: (() -> Void)?
|
var imageApply: (() -> Void)?
|
||||||
var updatedImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
var updatedImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
||||||
if let photo = item.invoice.photo, let dimensions = photo.dimensions {
|
if let photo = item.invoice.photo, let dimensions = photo.dimensions {
|
||||||
let arguments = TransformImageArguments(corners: ImageCorners(), imageSize: dimensions.aspectFilled(imageSize), boundingSize: imageSize, intrinsicInsets: UIEdgeInsets(), emptyColor: item.theme.list.mediaPlaceholderColor)
|
let arguments = TransformImageArguments(corners: ImageCorners(), imageSize: dimensions.cgSize.aspectFilled(imageSize), boundingSize: imageSize, intrinsicInsets: UIEdgeInsets(), emptyColor: item.theme.list.mediaPlaceholderColor)
|
||||||
imageApply = makeImageLayout(arguments)
|
imageApply = makeImageLayout(arguments)
|
||||||
maxTextWidth = max(1.0, maxTextWidth - imageSize.width - imageTextSpacing)
|
maxTextWidth = max(1.0, maxTextWidth - imageSize.width - imageTextSpacing)
|
||||||
if imageUpdated {
|
if imageUpdated {
|
||||||
|
@ -109,6 +109,6 @@ public final class ChatListSearchItemHeaderNode: ListViewItemHeaderNode {
|
|||||||
|
|
||||||
override public func animateRemoved(duration: Double) {
|
override public func animateRemoved(duration: Double) {
|
||||||
self.alpha = 0.0
|
self.alpha = 0.0
|
||||||
self.layer.animateAlpha(from: 1.0, to: 0.0, duration: duration, removeOnCompletion: false)
|
self.layer.animateAlpha(from: 1.0, to: 0.0, duration: duration, removeOnCompletion: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,8 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
|
|||||||
|
|
||||||
let navigationController: NavigationController?
|
let navigationController: NavigationController?
|
||||||
|
|
||||||
|
let passthroughTouches: Bool = true
|
||||||
|
|
||||||
init(controller: ViewController, sourceNode: ASDisplayNode?, navigationController: NavigationController?) {
|
init(controller: ViewController, sourceNode: ASDisplayNode?, navigationController: NavigationController?) {
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.sourceNode = sourceNode
|
self.sourceNode = sourceNode
|
||||||
@ -91,6 +93,9 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func animatedIn() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ChatListControllerImpl: TelegramBaseController, ChatListController, UIViewControllerPreviewingDelegate {
|
public class ChatListControllerImpl: TelegramBaseController, ChatListController, UIViewControllerPreviewingDelegate {
|
||||||
|
@ -1206,9 +1206,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
|
|
||||||
var dimensions: CGSize?
|
var dimensions: CGSize?
|
||||||
if let contentImageMedia = contentImageMedia as? TelegramMediaImage {
|
if let contentImageMedia = contentImageMedia as? TelegramMediaImage {
|
||||||
dimensions = largestRepresentationForPhoto(contentImageMedia)?.dimensions
|
dimensions = largestRepresentationForPhoto(contentImageMedia)?.dimensions.cgSize
|
||||||
} else if let contentImageMedia = contentImageMedia as? TelegramMediaFile {
|
} else if let contentImageMedia = contentImageMedia as? TelegramMediaFile {
|
||||||
dimensions = contentImageMedia.dimensions
|
dimensions = contentImageMedia.dimensions?.cgSize
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentImageNodeAppeared = false
|
var contentImageNodeAppeared = false
|
||||||
|
@ -33,6 +33,8 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
|
|||||||
|
|
||||||
let navigationController: NavigationController? = nil
|
let navigationController: NavigationController? = nil
|
||||||
|
|
||||||
|
let passthroughTouches: Bool = true
|
||||||
|
|
||||||
init(controller: ViewController, sourceNode: ASDisplayNode?) {
|
init(controller: ViewController, sourceNode: ASDisplayNode?) {
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.sourceNode = sourceNode
|
self.sourceNode = sourceNode
|
||||||
@ -48,6 +50,9 @@ private final class ContextControllerContentSourceImpl: ContextControllerContent
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func animatedIn() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ContactsControllerNode: ASDisplayNode {
|
final class ContactsControllerNode: ASDisplayNode {
|
||||||
|
@ -211,7 +211,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
if strongSelf.didCompleteAnimationIn {
|
if strongSelf.didCompleteAnimationIn {
|
||||||
if !strongSelf.didMoveFromInitialGesturePoint {
|
if !strongSelf.didMoveFromInitialGesturePoint {
|
||||||
let distance = abs(localPoint.y - initialPoint.y)
|
let distance = abs(localPoint.y - initialPoint.y)
|
||||||
if distance > 4.0 {
|
if distance > 12.0 {
|
||||||
strongSelf.didMoveFromInitialGesturePoint = true
|
strongSelf.didMoveFromInitialGesturePoint = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -581,6 +581,13 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
|
|
||||||
self.contentContainerNode.layer.animateSpring(from: min(localSourceFrame.width / self.contentContainerNode.frame.width, localSourceFrame.height / self.contentContainerNode.frame.height) as NSNumber, to: 1.0 as NSNumber, keyPath: "transform.scale", duration: springDuration, initialVelocity: 0.0, damping: springDamping)
|
self.contentContainerNode.layer.animateSpring(from: min(localSourceFrame.width / self.contentContainerNode.frame.width, localSourceFrame.height / self.contentContainerNode.frame.height) as NSNumber, to: 1.0 as NSNumber, keyPath: "transform.scale", duration: springDuration, initialVelocity: 0.0, damping: springDamping)
|
||||||
|
|
||||||
|
switch self.source {
|
||||||
|
case let .controller(controller):
|
||||||
|
controller.animatedIn()
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
let contentContainerOffset = CGPoint(x: localSourceFrame.center.x - self.contentContainerNode.frame.center.x, y: localSourceFrame.center.y - self.contentContainerNode.frame.center.y)
|
let contentContainerOffset = CGPoint(x: localSourceFrame.center.x - self.contentContainerNode.frame.center.x, y: localSourceFrame.center.y - self.contentContainerNode.frame.center.y)
|
||||||
if let contentNode = self.contentContainerNode.contentNode, case let .controller(controller) = contentNode {
|
if let contentNode = self.contentContainerNode.contentNode, case let .controller(controller) = contentNode {
|
||||||
let snapshotView: UIView? = nil// controller.sourceNode.view.snapshotContentTree()
|
let snapshotView: UIView? = nil// controller.sourceNode.view.snapshotContentTree()
|
||||||
@ -1099,7 +1106,16 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case let .controller(contentParentNode):
|
case let .controller(contentParentNode):
|
||||||
let projectedFrame = convertFrame(contentParentNode.sourceNode.bounds, from: contentParentNode.sourceNode.view, to: self.view)
|
var projectedFrame: CGRect = convertFrame(contentParentNode.sourceNode.bounds, from: contentParentNode.sourceNode.view, to: self.view)
|
||||||
|
switch self.source {
|
||||||
|
case let .controller(source):
|
||||||
|
let transitionInfo = source.transitionInfo()
|
||||||
|
if let (sourceNode, sourceRect) = transitionInfo?.sourceNode() {
|
||||||
|
projectedFrame = convertFrame(sourceRect, from: sourceNode.view, to: self.view)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
self.originalProjectedContentViewFrame = (projectedFrame, projectedFrame)
|
self.originalProjectedContentViewFrame = (projectedFrame, projectedFrame)
|
||||||
|
|
||||||
if let originalProjectedContentViewFrame = self.originalProjectedContentViewFrame {
|
if let originalProjectedContentViewFrame = self.originalProjectedContentViewFrame {
|
||||||
@ -1149,8 +1165,9 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
var contentHeight: CGFloat
|
var contentHeight: CGFloat
|
||||||
if case .compact = layout.metrics.widthClass {
|
if case .compact = layout.metrics.widthClass {
|
||||||
if layout.size.width < layout.size.height {
|
if layout.size.width < layout.size.height {
|
||||||
originalActionsFrame = CGRect(origin: CGPoint(x: actionsSideInset, y: min(maximumActionsFrameOrigin, floor((layout.size.height - contentActionsSpacing - contentSize.height) / 2.0) + contentSize.height + contentActionsSpacing)), size: actionsSize)
|
let sideInset = floor((layout.size.width - max(contentSize.width, actionsSize.width)) / 2.0)
|
||||||
originalContentFrame = CGRect(origin: CGPoint(x: actionsSideInset, y: originalActionsFrame.minY - contentActionsSpacing - contentSize.height), size: contentSize)
|
originalActionsFrame = CGRect(origin: CGPoint(x: sideInset, y: min(maximumActionsFrameOrigin, floor((layout.size.height - contentActionsSpacing - contentSize.height) / 2.0) + contentSize.height + contentActionsSpacing)), size: actionsSize)
|
||||||
|
originalContentFrame = CGRect(origin: CGPoint(x: sideInset, y: originalActionsFrame.minY - contentActionsSpacing - contentSize.height), size: contentSize)
|
||||||
if originalContentFrame.minY < topEdge {
|
if originalContentFrame.minY < topEdge {
|
||||||
let requiredOffset = topEdge - originalContentFrame.minY
|
let requiredOffset = topEdge - originalContentFrame.minY
|
||||||
let availableOffset = max(0.0, layout.size.height - layout.intrinsicInsets.bottom - actionsBottomInset - originalActionsFrame.maxY)
|
let availableOffset = max(0.0, layout.size.height - layout.intrinsicInsets.bottom - actionsBottomInset - originalActionsFrame.maxY)
|
||||||
@ -1271,6 +1288,14 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case let .controller(controller):
|
case let .controller(controller):
|
||||||
|
var passthrough = false
|
||||||
|
switch self.source {
|
||||||
|
case let .controller(controllerSource):
|
||||||
|
passthrough = controllerSource.passthroughTouches
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if passthrough {
|
||||||
let controllerPoint = self.view.convert(point, to: controller.controller.view)
|
let controllerPoint = self.view.convert(point, to: controller.controller.view)
|
||||||
if let result = controller.controller.view.hitTest(controllerPoint, with: event) {
|
if let result = controller.controller.view.hitTest(controllerPoint, with: event) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@ -1280,6 +1305,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if self.actionsContainerNode.frame.contains(mappedPoint) {
|
if self.actionsContainerNode.frame.contains(mappedPoint) {
|
||||||
return self.actionsContainerNode.hitTest(self.view.convert(point, to: self.actionsContainerNode.view), with: event)
|
return self.actionsContainerNode.hitTest(self.view.convert(point, to: self.actionsContainerNode.view), with: event)
|
||||||
@ -1325,8 +1351,11 @@ public protocol ContextExtractedContentSource: class {
|
|||||||
public protocol ContextControllerContentSource: class {
|
public protocol ContextControllerContentSource: class {
|
||||||
var controller: ViewController { get }
|
var controller: ViewController { get }
|
||||||
var navigationController: NavigationController? { get }
|
var navigationController: NavigationController? { get }
|
||||||
|
var passthroughTouches: Bool { get }
|
||||||
|
|
||||||
func transitionInfo() -> ContextControllerTakeControllerInfo?
|
func transitionInfo() -> ContextControllerTakeControllerInfo?
|
||||||
|
|
||||||
|
func animatedIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ContextContentSource {
|
public enum ContextContentSource {
|
||||||
|
@ -11,6 +11,8 @@ public final class ContextControllerSourceNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public var activated: ((ContextGesture) -> Void)?
|
public var activated: ((ContextGesture) -> Void)?
|
||||||
|
public var shouldBegin: ((CGPoint) -> Bool)?
|
||||||
|
public var customActivationProgress: ((CGFloat, ContextGestureTransition) -> Void)?
|
||||||
|
|
||||||
override public func didLoad() {
|
override public func didLoad() {
|
||||||
super.didLoad()
|
super.didLoad()
|
||||||
@ -19,10 +21,20 @@ public final class ContextControllerSourceNode: ASDisplayNode {
|
|||||||
self.contextGesture = contextGesture
|
self.contextGesture = contextGesture
|
||||||
self.view.addGestureRecognizer(contextGesture)
|
self.view.addGestureRecognizer(contextGesture)
|
||||||
|
|
||||||
|
contextGesture.shouldBegin = { [weak self] point in
|
||||||
|
guard let strongSelf = self, !strongSelf.bounds.width.isZero else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return strongSelf.shouldBegin?(point) ?? false
|
||||||
|
}
|
||||||
|
|
||||||
contextGesture.activationProgress = { [weak self] progress, update in
|
contextGesture.activationProgress = { [weak self] progress, update in
|
||||||
guard let strongSelf = self, !strongSelf.bounds.width.isZero else {
|
guard let strongSelf = self, !strongSelf.bounds.width.isZero else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if let customActivationProgress = strongSelf.customActivationProgress {
|
||||||
|
customActivationProgress(progress, update)
|
||||||
|
} else {
|
||||||
let minScale: CGFloat = (strongSelf.bounds.width - 10.0) / strongSelf.bounds.width
|
let minScale: CGFloat = (strongSelf.bounds.width - 10.0) / strongSelf.bounds.width
|
||||||
let currentScale = 1.0 * (1.0 - progress) + minScale * progress
|
let currentScale = 1.0 * (1.0 - progress) + minScale * progress
|
||||||
switch update {
|
switch update {
|
||||||
@ -36,6 +48,7 @@ public final class ContextControllerSourceNode: ASDisplayNode {
|
|||||||
strongSelf.layer.animateSpring(from: previousScale as NSNumber, to: currentScale as NSNumber, keyPath: "sublayerTransform.scale", duration: 0.5, delay: 0.0, initialVelocity: 0.0, damping: 90.0)
|
strongSelf.layer.animateSpring(from: previousScale as NSNumber, to: currentScale as NSNumber, keyPath: "sublayerTransform.scale", duration: 0.5, delay: 0.0, initialVelocity: 0.0, damping: 90.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
contextGesture.activated = { [weak self] gesture in
|
contextGesture.activated = { [weak self] gesture in
|
||||||
if let activated = self?.activated {
|
if let activated = self?.activated {
|
||||||
activated(gesture)
|
activated(gesture)
|
||||||
|
@ -56,6 +56,7 @@ public final class ContextGesture: UIGestureRecognizer, UIGestureRecognizerDeleg
|
|||||||
private var animator: DisplayLinkAnimator?
|
private var animator: DisplayLinkAnimator?
|
||||||
private var isValidated: Bool = false
|
private var isValidated: Bool = false
|
||||||
|
|
||||||
|
public var shouldBegin: ((CGPoint) -> Bool)?
|
||||||
public var activationProgress: ((CGFloat, ContextGestureTransition) -> Void)?
|
public var activationProgress: ((CGFloat, ContextGestureTransition) -> Void)?
|
||||||
public var activated: ((ContextGesture) -> Void)?
|
public var activated: ((ContextGesture) -> Void)?
|
||||||
public var externalUpdated: ((UIView?, CGPoint) -> Void)?
|
public var externalUpdated: ((UIView?, CGPoint) -> Void)?
|
||||||
@ -92,6 +93,13 @@ public final class ContextGesture: UIGestureRecognizer, UIGestureRecognizerDeleg
|
|||||||
override public func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
|
override public func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
|
||||||
super.touchesBegan(touches, with: event)
|
super.touchesBegan(touches, with: event)
|
||||||
|
|
||||||
|
if let shouldBegin = self.shouldBegin, let touch = touches.first {
|
||||||
|
if !shouldBegin(touch.location(in: self.view)) {
|
||||||
|
self.state = .failed
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if self.delayTimer == nil {
|
if self.delayTimer == nil {
|
||||||
let delayTimer = Timer(timeInterval: beginDelay, target: TimerTargetWrapper { [weak self] in
|
let delayTimer = Timer(timeInterval: beginDelay, target: TimerTargetWrapper { [weak self] in
|
||||||
guard let strongSelf = self, let _ = strongSelf.delayTimer else {
|
guard let strongSelf = self, let _ = strongSelf.delayTimer else {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string>Copyright © 2019 Telegram Messenger LLP. All rights reserved.</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,9 +0,0 @@
|
|||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
|
|
||||||
//! Project version number for crc32mac.
|
|
||||||
FOUNDATION_EXPORT double crc32macVersionNumber;
|
|
||||||
|
|
||||||
//! Project version string for crc32mac.
|
|
||||||
FOUNDATION_EXPORT const unsigned char crc32macVersionString[];
|
|
||||||
|
|
||||||
uint32_t Crc32(const void *bytes, int length);
|
|
@ -6,7 +6,7 @@ public protocol KeyShortcutResponder {
|
|||||||
|
|
||||||
public class KeyShortcutsController: UIResponder {
|
public class KeyShortcutsController: UIResponder {
|
||||||
private var effectiveShortcuts: [KeyShortcut]?
|
private var effectiveShortcuts: [KeyShortcut]?
|
||||||
private var viewControllerEnumerator: ((ContainableController) -> Bool) -> Void
|
private var viewControllerEnumerator: (@escaping (ContainableController) -> Bool) -> Void
|
||||||
|
|
||||||
public static var isAvailable: Bool {
|
public static var isAvailable: Bool {
|
||||||
if #available(iOSApplicationExtension 8.0, iOS 8.0, *), UIDevice.current.userInterfaceIdiom == .pad {
|
if #available(iOSApplicationExtension 8.0, iOS 8.0, *), UIDevice.current.userInterfaceIdiom == .pad {
|
||||||
@ -16,7 +16,7 @@ public class KeyShortcutsController: UIResponder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(enumerator: @escaping ((ContainableController) -> Bool) -> Void) {
|
public init(enumerator: @escaping (@escaping (ContainableController) -> Bool) -> Void) {
|
||||||
self.viewControllerEnumerator = enumerator
|
self.viewControllerEnumerator = enumerator
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
public final var generalScrollDirectionUpdated: (GeneralScrollDirection) -> Void = { _ in }
|
public final var generalScrollDirectionUpdated: (GeneralScrollDirection) -> Void = { _ in }
|
||||||
|
|
||||||
public final var reorderItem: (Int, Int, Any?) -> Signal<Bool, NoError> = { _, _, _ in return .single(false) }
|
public final var reorderItem: (Int, Int, Any?) -> Signal<Bool, NoError> = { _, _, _ in return .single(false) }
|
||||||
|
public final var reorderCompleted: (Any?) -> Void = { _ in }
|
||||||
|
|
||||||
private final var animations: [ListViewAnimation] = []
|
private final var animations: [ListViewAnimation] = []
|
||||||
private final var actionsForVSync: [() -> ()] = []
|
private final var actionsForVSync: [() -> ()] = []
|
||||||
@ -439,6 +440,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
reorderNode.removeFromSupernode()
|
reorderNode.removeFromSupernode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.reorderCompleted(self.opaqueTransactionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updateReordering(offset: CGFloat) {
|
private func updateReordering(offset: CGFloat) {
|
||||||
@ -2680,6 +2682,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
if highlightedItemNode.index != self.highlightedItemIndex {
|
if highlightedItemNode.index != self.highlightedItemIndex {
|
||||||
highlightedItemNode.setHighlighted(false, at: CGPoint(), animated: false)
|
highlightedItemNode.setHighlighted(false, at: CGPoint(), animated: false)
|
||||||
self.highlightedItemIndex = nil
|
self.highlightedItemIndex = nil
|
||||||
|
self.selectionTouchLocation = nil
|
||||||
}
|
}
|
||||||
} else if self.highlightedItemIndex != nil {
|
} else if self.highlightedItemIndex != nil {
|
||||||
self.highlightedItemIndex = nil
|
self.highlightedItemIndex = nil
|
||||||
|
@ -899,6 +899,8 @@ public class Window1 {
|
|||||||
self.presentationContext.updateToInterfaceOrientation(orientation)
|
self.presentationContext.updateToInterfaceOrientation(orientation)
|
||||||
self.overlayPresentationContext.updateToInterfaceOrientation(orientation)
|
self.overlayPresentationContext.updateToInterfaceOrientation(orientation)
|
||||||
|
|
||||||
|
self.topPresentationContext.updateToInterfaceOrientation(orientation)
|
||||||
|
|
||||||
for controller in self.topLevelOverlayControllers {
|
for controller in self.topLevelOverlayControllers {
|
||||||
controller.updateToInterfaceOrientation(orientation)
|
controller.updateToInterfaceOrientation(orientation)
|
||||||
}
|
}
|
||||||
@ -973,6 +975,8 @@ public class Window1 {
|
|||||||
self.presentationContext.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
self.presentationContext.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
||||||
self.overlayPresentationContext.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
self.overlayPresentationContext.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
||||||
|
|
||||||
|
self.topPresentationContext.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
||||||
|
|
||||||
for controller in self.topLevelOverlayControllers {
|
for controller in self.topLevelOverlayControllers {
|
||||||
updatingLayout.transition.updateFrame(node: controller.displayNode, frame: CGRect(origin: CGPoint(), size: self.windowLayout.size))
|
updatingLayout.transition.updateFrame(node: controller.displayNode, frame: CGRect(origin: CGPoint(), size: self.windowLayout.size))
|
||||||
controller.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
controller.containerLayoutUpdated(childLayout, transition: updatingLayout.transition)
|
||||||
@ -1168,11 +1172,15 @@ public class Window1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func forEachViewController(_ f: (ContainableController) -> Bool) {
|
public func forEachViewController(_ f: (ContainableController) -> Bool) {
|
||||||
|
if let navigationController = self._rootController as? NavigationController, let controller = navigationController.topOverlayController {
|
||||||
|
!f(controller)
|
||||||
|
}
|
||||||
for (controller, _) in self.presentationContext.controllers {
|
for (controller, _) in self.presentationContext.controllers {
|
||||||
if !f(controller) {
|
if !f(controller) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for controller in self.topLevelOverlayControllers {
|
for controller in self.topLevelOverlayControllers {
|
||||||
if !f(controller) {
|
if !f(controller) {
|
||||||
break
|
break
|
||||||
|
@ -55,6 +55,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (NSData * _Nullable)rsaEncryptPKCS1OAEPWithPublicKey:(NSString *)publicKey data:(NSData *)data;
|
- (NSData * _Nullable)rsaEncryptPKCS1OAEPWithPublicKey:(NSString *)publicKey data:(NSData *)data;
|
||||||
- (id<MTRsaPublicKey>)parseRSAPublicKey:(NSString *)publicKey;
|
- (id<MTRsaPublicKey>)parseRSAPublicKey:(NSString *)publicKey;
|
||||||
|
|
||||||
|
-(NSData * _Nonnull)macosRSAEncrypt:(NSString *) publicKey data: (NSData *)data;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@ -204,7 +204,7 @@ public func galleryItemForEntry(context: AccountContext, presentationData: Prese
|
|||||||
if let file = webpageContent.file, file.isVideo {
|
if let file = webpageContent.file, file.isVideo {
|
||||||
content = NativeVideoContent(id: .message(message.stableId, file.fileId), fileReference: .message(message: MessageReference(message), media: file), imageReference: mediaImage.flatMap({ ImageMediaReference.message(message: MessageReference(message), media: $0) }), streamVideo: .conservative, loopVideo: loopVideos, tempFilePath: tempFilePath)
|
content = NativeVideoContent(id: .message(message.stableId, file.fileId), fileReference: .message(message: MessageReference(message), media: file), imageReference: mediaImage.flatMap({ ImageMediaReference.message(message: MessageReference(message), media: $0) }), streamVideo: .conservative, loopVideo: loopVideos, tempFilePath: tempFilePath)
|
||||||
} else if URL(string: embedUrl)?.pathExtension == "mp4" {
|
} else if URL(string: embedUrl)?.pathExtension == "mp4" {
|
||||||
content = SystemVideoContent(url: embedUrl, imageReference: .webPage(webPage: WebpageReference(webpage), media: image), dimensions: webpageContent.embedSize ?? CGSize(width: 640.0, height: 640.0), duration: Int32(webpageContent.duration ?? 0))
|
content = SystemVideoContent(url: embedUrl, imageReference: .webPage(webPage: WebpageReference(webpage), media: image), dimensions: webpageContent.embedSize?.cgSize ?? CGSize(width: 640.0, height: 640.0), duration: Int32(webpageContent.duration ?? 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if content == nil, let webEmbedContent = WebEmbedVideoContent(webPage: webpage, webpageContent: webpageContent, forcedTimestamp: timecode.flatMap(Int.init)) {
|
if content == nil, let webEmbedContent = WebEmbedVideoContent(webPage: webpage, webpageContent: webpageContent, forcedTimestamp: timecode.flatMap(Int.init)) {
|
||||||
|
@ -60,13 +60,13 @@ final class ChatMediaGalleryThumbnailItem: GalleryThumbnailItem {
|
|||||||
switch self.thumbnail {
|
switch self.thumbnail {
|
||||||
case let .image(imageReference):
|
case let .image(imageReference):
|
||||||
if let representation = largestImageRepresentation(imageReference.media.representations) {
|
if let representation = largestImageRepresentation(imageReference.media.representations) {
|
||||||
return (mediaGridMessagePhoto(account: self.account, photoReference: imageReference), representation.dimensions)
|
return (mediaGridMessagePhoto(account: self.account, photoReference: imageReference), representation.dimensions.cgSize)
|
||||||
} else {
|
} else {
|
||||||
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
||||||
}
|
}
|
||||||
case let .video(fileReference):
|
case let .video(fileReference):
|
||||||
if let representation = largestImageRepresentation(fileReference.media.previewRepresentations) {
|
if let representation = largestImageRepresentation(fileReference.media.previewRepresentations) {
|
||||||
return (mediaGridMessageVideo(postbox: self.account.postbox, videoReference: fileReference), representation.dimensions)
|
return (mediaGridMessageVideo(postbox: self.account.postbox, videoReference: fileReference), representation.dimensions.cgSize)
|
||||||
} else {
|
} else {
|
||||||
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
||||||
}
|
}
|
||||||
@ -220,10 +220,10 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
fileprivate func setImage(imageReference: ImageMediaReference) {
|
fileprivate func setImage(imageReference: ImageMediaReference) {
|
||||||
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: imageReference.media) {
|
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: imageReference.media) {
|
||||||
if let largestSize = largestRepresentationForPhoto(imageReference.media) {
|
if let largestSize = largestRepresentationForPhoto(imageReference.media) {
|
||||||
let displaySize = largestSize.dimensions.fitted(CGSize(width: 1280.0, height: 1280.0)).dividedByScreenScale().integralFloor
|
let displaySize = largestSize.dimensions.cgSize.fitted(CGSize(width: 1280.0, height: 1280.0)).dividedByScreenScale().integralFloor
|
||||||
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
||||||
self.imageNode.setSignal(chatMessagePhoto(postbox: context.account.postbox, photoReference: imageReference), dispatchOnDisplayLink: false)
|
self.imageNode.setSignal(chatMessagePhoto(postbox: context.account.postbox, photoReference: imageReference), dispatchOnDisplayLink: false)
|
||||||
self.zoomableContent = (largestSize.dimensions, self.imageNode)
|
self.zoomableContent = (largestSize.dimensions.cgSize, self.imageNode)
|
||||||
|
|
||||||
self.fetchDisposable.set(fetchedMediaResource(mediaBox: self.context.account.postbox.mediaBox, reference: imageReference.resourceReference(largestSize.resource)).start())
|
self.fetchDisposable.set(fetchedMediaResource(mediaBox: self.context.account.postbox.mediaBox, reference: imageReference.resourceReference(largestSize.resource)).start())
|
||||||
self.setupStatus(resource: largestSize.resource)
|
self.setupStatus(resource: largestSize.resource)
|
||||||
@ -237,18 +237,18 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
func setFile(context: AccountContext, fileReference: FileMediaReference) {
|
func setFile(context: AccountContext, fileReference: FileMediaReference) {
|
||||||
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
|
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
|
||||||
if var largestSize = fileReference.media.dimensions {
|
if var largestSize = fileReference.media.dimensions {
|
||||||
var displaySize = largestSize.dividedByScreenScale()
|
var displaySize = largestSize.cgSize.dividedByScreenScale()
|
||||||
if let previewDimensions = largestImageRepresentation(fileReference.media.previewRepresentations)?.dimensions {
|
if let previewDimensions = largestImageRepresentation(fileReference.media.previewRepresentations)?.dimensions {
|
||||||
let previewAspect = previewDimensions.width / previewDimensions.height
|
let previewAspect = CGFloat(previewDimensions.width) / CGFloat(previewDimensions.height)
|
||||||
let aspect = displaySize.width / displaySize.height
|
let aspect = displaySize.width / displaySize.height
|
||||||
if abs(previewAspect - 1.0 / aspect) < 0.1 {
|
if abs(previewAspect - 1.0 / aspect) < 0.1 {
|
||||||
displaySize = CGSize(width: displaySize.height, height: displaySize.width)
|
displaySize = CGSize(width: displaySize.height, height: displaySize.width)
|
||||||
largestSize = CGSize(width: largestSize.height, height: largestSize.width)
|
largestSize = PixelDimensions(width: largestSize.height, height: largestSize.width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
||||||
self.imageNode.setSignal(chatMessageImageFile(account: context.account, fileReference: fileReference, thumbnail: false), dispatchOnDisplayLink: false)
|
self.imageNode.setSignal(chatMessageImageFile(account: context.account, fileReference: fileReference, thumbnail: false), dispatchOnDisplayLink: false)
|
||||||
self.zoomableContent = (largestSize, self.imageNode)
|
self.zoomableContent = (largestSize.cgSize, self.imageNode)
|
||||||
self.setupStatus(resource: fileReference.media.resource)
|
self.setupStatus(resource: fileReference.media.resource)
|
||||||
} else {
|
} else {
|
||||||
self._ready.set(.single(Void()))
|
self._ready.set(.single(Void()))
|
||||||
|
@ -167,6 +167,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
private var pictureInPictureNode: UniversalVideoGalleryItemPictureInPictureNode?
|
private var pictureInPictureNode: UniversalVideoGalleryItemPictureInPictureNode?
|
||||||
private let statusButtonNode: HighlightableButtonNode
|
private let statusButtonNode: HighlightableButtonNode
|
||||||
private let statusNode: RadialStatusNode
|
private let statusNode: RadialStatusNode
|
||||||
|
private var statusNodeShouldBeHidden = true
|
||||||
|
|
||||||
private var isCentral = false
|
private var isCentral = false
|
||||||
private var _isVisible: Bool?
|
private var _isVisible: Bool?
|
||||||
@ -463,7 +464,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.statusDisposable.set((combineLatest(videoNode.status, mediaFileStatus)
|
self.statusDisposable.set((combineLatest(queue: .mainQueue(), videoNode.status, mediaFileStatus)
|
||||||
|> deliverOnMainQueue).start(next: { [weak self] value, fetchStatus in
|
|> deliverOnMainQueue).start(next: { [weak self] value, fetchStatus in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
var initialBuffering = false
|
var initialBuffering = false
|
||||||
@ -496,6 +497,13 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
default:
|
default:
|
||||||
isStreaming = true
|
isStreaming = true
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
switch fetchStatus {
|
||||||
|
case .Local:
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
isStreaming = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if let content = item.content as? NativeVideoContent, !isStreaming {
|
if let content = item.content as? NativeVideoContent, !isStreaming {
|
||||||
initialBuffering = false
|
initialBuffering = false
|
||||||
@ -542,7 +550,8 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
strongSelf.fetchStatus = fetchStatus
|
strongSelf.fetchStatus = fetchStatus
|
||||||
|
|
||||||
if !item.hideControls {
|
if !item.hideControls {
|
||||||
strongSelf.statusButtonNode.isHidden = strongSelf.hideStatusNodeUntilCentrality || (!initialBuffering && (strongSelf.didPause || !isPaused) && !fetching)
|
strongSelf.statusNodeShouldBeHidden = (!initialBuffering && (strongSelf.didPause || !isPaused) && !fetching)
|
||||||
|
strongSelf.statusButtonNode.isHidden = strongSelf.hideStatusNodeUntilCentrality || strongSelf.statusNodeShouldBeHidden
|
||||||
}
|
}
|
||||||
|
|
||||||
if isAnimated || disablePlayerControls {
|
if isAnimated || disablePlayerControls {
|
||||||
@ -648,6 +657,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.hideStatusNodeUntilCentrality = false
|
self.hideStatusNodeUntilCentrality = false
|
||||||
|
self.statusButtonNode.isHidden = self.hideStatusNodeUntilCentrality || self.statusNodeShouldBeHidden
|
||||||
if videoNode.ownsContentNode {
|
if videoNode.ownsContentNode {
|
||||||
if isAnimated {
|
if isAnimated {
|
||||||
videoNode.seek(0.0)
|
videoNode.seek(0.0)
|
||||||
@ -731,6 +741,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
videoNode.play()
|
videoNode.play()
|
||||||
} else {
|
} else {
|
||||||
self.hideStatusNodeUntilCentrality = false
|
self.hideStatusNodeUntilCentrality = false
|
||||||
|
self.statusButtonNode.isHidden = self.hideStatusNodeUntilCentrality || self.statusNodeShouldBeHidden
|
||||||
videoNode.playOnceWithSound(playAndRecord: false, seek: seek, actionAtEnd: .stop)
|
videoNode.playOnceWithSound(playAndRecord: false, seek: seek, actionAtEnd: .stop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@ private struct InstantImageGalleryThumbnailItem: GalleryThumbnailItem {
|
|||||||
|
|
||||||
var image: (Signal<(TransformImageArguments) -> DrawingContext?, NoError>, CGSize) {
|
var image: (Signal<(TransformImageArguments) -> DrawingContext?, NoError>, CGSize) {
|
||||||
if let imageReferene = mediaReference.concrete(TelegramMediaImage.self), let representation = largestImageRepresentation(imageReferene.media.representations) {
|
if let imageReferene = mediaReference.concrete(TelegramMediaImage.self), let representation = largestImageRepresentation(imageReferene.media.representations) {
|
||||||
return (mediaGridMessagePhoto(account: self.account, photoReference: imageReferene), representation.dimensions)
|
return (mediaGridMessagePhoto(account: self.account, photoReference: imageReferene), representation.dimensions.cgSize)
|
||||||
} else if let fileReference = mediaReference.concrete(TelegramMediaFile.self), let dimensions = fileReference.media.dimensions {
|
} else if let fileReference = mediaReference.concrete(TelegramMediaFile.self), let dimensions = fileReference.media.dimensions {
|
||||||
return (mediaGridMessageVideo(postbox: account.postbox, videoReference: fileReference), dimensions)
|
return (mediaGridMessageVideo(postbox: account.postbox, videoReference: fileReference), dimensions.cgSize)
|
||||||
} else {
|
} else {
|
||||||
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
return (.single({ _ in return nil }), CGSize(width: 128.0, height: 128.0))
|
||||||
}
|
}
|
||||||
@ -133,10 +133,10 @@ final class InstantImageGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
fileprivate func setImage(imageReference: ImageMediaReference) {
|
fileprivate func setImage(imageReference: ImageMediaReference) {
|
||||||
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: imageReference.media) {
|
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: imageReference.media) {
|
||||||
if let largestSize = largestRepresentationForPhoto(imageReference.media) {
|
if let largestSize = largestRepresentationForPhoto(imageReference.media) {
|
||||||
let displaySize = largestSize.dimensions.fitted(CGSize(width: 1280.0, height: 1280.0)).dividedByScreenScale().integralFloor
|
let displaySize = largestSize.dimensions.cgSize.fitted(CGSize(width: 1280.0, height: 1280.0)).dividedByScreenScale().integralFloor
|
||||||
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets(), emptyColor: .black))()
|
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets(), emptyColor: .black))()
|
||||||
self.imageNode.setSignal(chatMessagePhoto(postbox: self.context.account.postbox, photoReference: imageReference), dispatchOnDisplayLink: false)
|
self.imageNode.setSignal(chatMessagePhoto(postbox: self.context.account.postbox, photoReference: imageReference), dispatchOnDisplayLink: false)
|
||||||
self.zoomableContent = (largestSize.dimensions, self.imageNode)
|
self.zoomableContent = (largestSize.dimensions.cgSize, self.imageNode)
|
||||||
self.fetchDisposable.set(fetchedMediaResource(mediaBox: self.context.account.postbox.mediaBox, reference: imageReference.resourceReference(largestSize.resource)).start())
|
self.fetchDisposable.set(fetchedMediaResource(mediaBox: self.context.account.postbox.mediaBox, reference: imageReference.resourceReference(largestSize.resource)).start())
|
||||||
} else {
|
} else {
|
||||||
self._ready.set(.single(Void()))
|
self._ready.set(.single(Void()))
|
||||||
@ -149,10 +149,10 @@ final class InstantImageGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
func setFile(context: AccountContext, fileReference: FileMediaReference) {
|
func setFile(context: AccountContext, fileReference: FileMediaReference) {
|
||||||
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
|
if self.contextAndMedia == nil || !self.contextAndMedia!.1.media.isEqual(to: fileReference.media) {
|
||||||
if let largestSize = fileReference.media.dimensions {
|
if let largestSize = fileReference.media.dimensions {
|
||||||
let displaySize = largestSize.dividedByScreenScale()
|
let displaySize = largestSize.cgSize.dividedByScreenScale()
|
||||||
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
self.imageNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets()))()
|
||||||
self.imageNode.setSignal(chatMessageImageFile(account: context.account, fileReference: fileReference, thumbnail: false), dispatchOnDisplayLink: false)
|
self.imageNode.setSignal(chatMessageImageFile(account: context.account, fileReference: fileReference, thumbnail: false), dispatchOnDisplayLink: false)
|
||||||
self.zoomableContent = (largestSize, self.imageNode)
|
self.zoomableContent = (largestSize.cgSize, self.imageNode)
|
||||||
} else {
|
} else {
|
||||||
self._ready.set(.single(Void()))
|
self._ready.set(.single(Void()))
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ final class InstantPageArticleNode: ASDisplayNode, InstantPageNode {
|
|||||||
self.contentTileNode.frame = self.bounds
|
self.contentTileNode.frame = self.bounds
|
||||||
|
|
||||||
if let imageNode = self.imageNode, let image = self.cover, let largest = largestImageRepresentation(image.representations) {
|
if let imageNode = self.imageNode, let image = self.cover, let largest = largestImageRepresentation(image.representations) {
|
||||||
let size = largest.dimensions.aspectFilled(imageSize)
|
let size = largest.dimensions.cgSize.aspectFilled(imageSize)
|
||||||
let boundingSize = imageSize
|
let boundingSize = imageSize
|
||||||
|
|
||||||
let makeLayout = imageNode.asyncLayout()
|
let makeLayout = imageNode.asyncLayout()
|
||||||
|
@ -199,7 +199,7 @@ final class InstantPageImageNode: ASDisplayNode, InstantPageNode {
|
|||||||
self.statusNode.frame = CGRect(x: floorToScreenPixels((size.width - radialStatusSize) / 2.0), y: floorToScreenPixels((size.height - radialStatusSize) / 2.0), width: radialStatusSize, height: radialStatusSize)
|
self.statusNode.frame = CGRect(x: floorToScreenPixels((size.width - radialStatusSize) / 2.0), y: floorToScreenPixels((size.height - radialStatusSize) / 2.0), width: radialStatusSize, height: radialStatusSize)
|
||||||
|
|
||||||
if let image = self.media.media as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
if let image = self.media.media as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
||||||
let imageSize = largest.dimensions.aspectFilled(size)
|
let imageSize = largest.dimensions.cgSize.aspectFilled(size)
|
||||||
let boundingSize = size
|
let boundingSize = size
|
||||||
let radius: CGFloat = self.roundCorners ? floor(min(imageSize.width, imageSize.height) / 2.0) : 0.0
|
let radius: CGFloat = self.roundCorners ? floor(min(imageSize.width, imageSize.height) / 2.0) : 0.0
|
||||||
let makeLayout = self.imageNode.asyncLayout()
|
let makeLayout = self.imageNode.asyncLayout()
|
||||||
@ -210,7 +210,7 @@ final class InstantPageImageNode: ASDisplayNode, InstantPageNode {
|
|||||||
} else if let file = self.media.media as? TelegramMediaFile, let dimensions = file.dimensions {
|
} else if let file = self.media.media as? TelegramMediaFile, let dimensions = file.dimensions {
|
||||||
let emptyColor = file.mimeType.hasPrefix("image/") ? self.theme.imageTintColor : nil
|
let emptyColor = file.mimeType.hasPrefix("image/") ? self.theme.imageTintColor : nil
|
||||||
|
|
||||||
let imageSize = dimensions.aspectFilled(size)
|
let imageSize = dimensions.cgSize.aspectFilled(size)
|
||||||
let boundingSize = size
|
let boundingSize = size
|
||||||
let makeLayout = self.imageNode.asyncLayout()
|
let makeLayout = self.imageNode.asyncLayout()
|
||||||
let apply = makeLayout(TransformImageArguments(corners: ImageCorners(), imageSize: imageSize, boundingSize: boundingSize, intrinsicInsets: UIEdgeInsets(), emptyColor: emptyColor))
|
let apply = makeLayout(TransformImageArguments(corners: ImageCorners(), imageSize: imageSize, boundingSize: boundingSize, intrinsicInsets: UIEdgeInsets(), emptyColor: emptyColor))
|
||||||
@ -234,7 +234,7 @@ final class InstantPageImageNode: ASDisplayNode, InstantPageNode {
|
|||||||
self.pinNode.frame = CGRect(origin: CGPoint(x: floor((size.width - pinSize.width) / 2.0), y: floor(size.height * 0.5 - 10.0 - pinSize.height / 2.0)), size: pinSize)
|
self.pinNode.frame = CGRect(origin: CGPoint(x: floor((size.width - pinSize.width) / 2.0), y: floor(size.height * 0.5 - 10.0 - pinSize.height / 2.0)), size: pinSize)
|
||||||
pinApply()
|
pinApply()
|
||||||
} else if let webPage = media.media as? TelegramMediaWebpage, case let .Loaded(content) = webPage.content, let image = content.image, let largest = largestImageRepresentation(image.representations) {
|
} else if let webPage = media.media as? TelegramMediaWebpage, case let .Loaded(content) = webPage.content, let image = content.image, let largest = largestImageRepresentation(image.representations) {
|
||||||
let imageSize = largest.dimensions.aspectFilled(size)
|
let imageSize = largest.dimensions.cgSize.aspectFilled(size)
|
||||||
let boundingSize = size
|
let boundingSize = size
|
||||||
let radius: CGFloat = self.roundCorners ? floor(min(imageSize.width, imageSize.height) / 2.0) : 0.0
|
let radius: CGFloat = self.roundCorners ? floor(min(imageSize.width, imageSize.height) / 2.0) : 0.0
|
||||||
let makeLayout = self.imageNode.asyncLayout()
|
let makeLayout = self.imageNode.asyncLayout()
|
||||||
|
@ -376,12 +376,12 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
case let .image(id, caption, url, webpageId):
|
case let .image(id, caption, url, webpageId):
|
||||||
if let image = media[id] as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
if let image = media[id] as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
||||||
let imageSize = largest.dimensions
|
let imageSize = largest.dimensions
|
||||||
var filledSize = imageSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
var filledSize = imageSize.cgSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
||||||
|
|
||||||
if let size = fillToSize {
|
if let size = fillToSize {
|
||||||
filledSize = size
|
filledSize = size
|
||||||
} else if isCover {
|
} else if isCover {
|
||||||
filledSize = imageSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
filledSize = imageSize.cgSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
||||||
if !filledSize.height.isZero {
|
if !filledSize.height.isZero {
|
||||||
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
||||||
}
|
}
|
||||||
@ -416,12 +416,12 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
case let .video(id, caption, autoplay, loop):
|
case let .video(id, caption, autoplay, loop):
|
||||||
if let file = media[id] as? TelegramMediaFile, let dimensions = file.dimensions {
|
if let file = media[id] as? TelegramMediaFile, let dimensions = file.dimensions {
|
||||||
let imageSize = dimensions
|
let imageSize = dimensions
|
||||||
var filledSize = imageSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
var filledSize = imageSize.cgSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
||||||
|
|
||||||
if let size = fillToSize {
|
if let size = fillToSize {
|
||||||
filledSize = size
|
filledSize = size
|
||||||
} else if isCover {
|
} else if isCover {
|
||||||
filledSize = imageSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
filledSize = imageSize.cgSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
||||||
if !filledSize.height.isZero {
|
if !filledSize.height.isZero {
|
||||||
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
||||||
}
|
}
|
||||||
@ -462,11 +462,11 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
switch subItem {
|
switch subItem {
|
||||||
case let .image(id, _, _, _):
|
case let .image(id, _, _, _):
|
||||||
if let image = media[id] as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
if let image = media[id] as? TelegramMediaImage, let largest = largestImageRepresentation(image.representations) {
|
||||||
size = largest.dimensions
|
size = largest.dimensions.cgSize
|
||||||
}
|
}
|
||||||
case let .video(id, _, _, _):
|
case let .video(id, _, _, _):
|
||||||
if let file = media[id] as? TelegramMediaFile, let dimensions = file.dimensions {
|
if let file = media[id] as? TelegramMediaFile, let dimensions = file.dimensions {
|
||||||
size = dimensions
|
size = dimensions.cgSize
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@ -577,7 +577,7 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
let mediaIndex = mediaIndexCounter
|
let mediaIndex = mediaIndexCounter
|
||||||
mediaIndexCounter += 1
|
mediaIndexCounter += 1
|
||||||
|
|
||||||
let filledSize = imageSize.fitted(CGSize(width: boundingWidth, height: 1200.0))
|
let filledSize = imageSize.cgSize.fitted(CGSize(width: boundingWidth, height: 1200.0))
|
||||||
contentSize.height = max(contentSize.height, filledSize.height)
|
contentSize.height = max(contentSize.height, filledSize.height)
|
||||||
|
|
||||||
var mediaUrl: InstantPageUrlItem?
|
var mediaUrl: InstantPageUrlItem?
|
||||||
@ -610,10 +610,10 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
|
|
||||||
let size: CGSize
|
let size: CGSize
|
||||||
if let dimensions = dimensions {
|
if let dimensions = dimensions {
|
||||||
if dimensions.width.isLessThanOrEqualTo(0.0) {
|
if dimensions.width <= 0 {
|
||||||
size = CGSize(width: embedBoundingWidth, height: dimensions.height)
|
size = CGSize(width: embedBoundingWidth, height: dimensions.cgSize.height)
|
||||||
} else {
|
} else {
|
||||||
size = dimensions.aspectFitted(CGSize(width: embedBoundingWidth, height: embedBoundingWidth))
|
size = dimensions.cgSize.aspectFitted(CGSize(width: embedBoundingWidth, height: embedBoundingWidth))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if let height = webEmbedHeights[embedIndex] {
|
if let height = webEmbedHeights[embedIndex] {
|
||||||
@ -628,7 +628,7 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
let frame = CGRect(origin: CGPoint(x: floor((boundingWidth - size.width) / 2.0), y: 0.0), size: size)
|
let frame = CGRect(origin: CGPoint(x: floor((boundingWidth - size.width) / 2.0), y: 0.0), size: size)
|
||||||
let item: InstantPageItem
|
let item: InstantPageItem
|
||||||
if let url = url, let coverId = coverId, let image = media[coverId] as? TelegramMediaImage {
|
if let url = url, let coverId = coverId, let image = media[coverId] as? TelegramMediaImage {
|
||||||
let loadedContent = TelegramMediaWebpageLoadedContent(url: url, displayUrl: url, hash: 0, type: "video", websiteName: nil, title: nil, text: nil, embedUrl: url, embedType: "video", embedSize: size, duration: nil, author: nil, image: image, file: nil, files: nil, instantPage: nil)
|
let loadedContent = TelegramMediaWebpageLoadedContent(url: url, displayUrl: url, hash: 0, type: "video", websiteName: nil, title: nil, text: nil, embedUrl: url, embedType: "video", embedSize: PixelDimensions(size), duration: nil, author: nil, image: image, file: nil, files: nil, instantPage: nil)
|
||||||
let content = TelegramMediaWebpageContent.Loaded(loadedContent)
|
let content = TelegramMediaWebpageContent.Loaded(loadedContent)
|
||||||
|
|
||||||
item = InstantPageImageItem(frame: frame, webPage: webpage, media: InstantPageMedia(index: embedIndex, media: TelegramMediaWebpage(webpageId: MediaId(namespace: Namespaces.Media.LocalWebpage, id: -1), content: content), url: nil, caption: nil, credit: nil), attributes: [], interactive: true, roundCorners: false, fit: false)
|
item = InstantPageImageItem(frame: frame, webPage: webpage, media: InstantPageMedia(index: embedIndex, media: TelegramMediaWebpage(webpageId: MediaId(namespace: Namespaces.Media.LocalWebpage, id: -1), content: content), url: nil, caption: nil, credit: nil), attributes: [], interactive: true, roundCorners: false, fit: false)
|
||||||
@ -805,19 +805,19 @@ func layoutInstantPageBlock(webpage: TelegramMediaWebpage, rtl: Bool, block: Ins
|
|||||||
return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items)
|
return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items)
|
||||||
case let .map(latitude, longitude, zoom, dimensions, caption):
|
case let .map(latitude, longitude, zoom, dimensions, caption):
|
||||||
let imageSize = dimensions
|
let imageSize = dimensions
|
||||||
var filledSize = imageSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
var filledSize = imageSize.cgSize.aspectFitted(CGSize(width: boundingWidth - safeInset * 2.0, height: 1200.0))
|
||||||
|
|
||||||
if let size = fillToSize {
|
if let size = fillToSize {
|
||||||
filledSize = size
|
filledSize = size
|
||||||
} else if isCover {
|
} else if isCover {
|
||||||
filledSize = imageSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
filledSize = imageSize.cgSize.aspectFilled(CGSize(width: boundingWidth - safeInset * 2.0, height: 1.0))
|
||||||
if !filledSize.height.isZero {
|
if !filledSize.height.isZero {
|
||||||
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
filledSize = filledSize.cropped(CGSize(width: boundingWidth - safeInset * 2.0, height: floor((boundingWidth - safeInset * 2.0) * 3.0 / 5.0)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let map = TelegramMediaMap(latitude: latitude, longitude: longitude, geoPlace: nil, venue: nil, liveBroadcastingTimeout: nil)
|
let map = TelegramMediaMap(latitude: latitude, longitude: longitude, geoPlace: nil, venue: nil, liveBroadcastingTimeout: nil)
|
||||||
let attributes: [InstantPageImageAttribute] = [InstantPageMapAttribute(zoom: zoom, dimensions: dimensions)]
|
let attributes: [InstantPageImageAttribute] = [InstantPageMapAttribute(zoom: zoom, dimensions: dimensions.cgSize)]
|
||||||
|
|
||||||
var contentSize = CGSize(width: boundingWidth - safeInset * 2.0, height: 0.0)
|
var contentSize = CGSize(width: boundingWidth - safeInset * 2.0, height: 0.0)
|
||||||
var items: [InstantPageItem] = []
|
var items: [InstantPageItem] = []
|
||||||
|
@ -520,10 +520,10 @@ func attributedStringForRichText(_ text: RichText, styleStack: InstantPageTextSt
|
|||||||
}
|
}
|
||||||
var dimensions = dimensions
|
var dimensions = dimensions
|
||||||
if let boundingWidth = boundingWidth {
|
if let boundingWidth = boundingWidth {
|
||||||
dimensions = dimensions.fittedToWidthOrSmaller(boundingWidth)
|
dimensions = PixelDimensions(dimensions.cgSize.fittedToWidthOrSmaller(boundingWidth))
|
||||||
}
|
}
|
||||||
let extentBuffer = UnsafeMutablePointer<RunStruct>.allocate(capacity: 1)
|
let extentBuffer = UnsafeMutablePointer<RunStruct>.allocate(capacity: 1)
|
||||||
extentBuffer.initialize(to: RunStruct(ascent: 0.0, descent: 0.0, width: dimensions.width))
|
extentBuffer.initialize(to: RunStruct(ascent: 0.0, descent: 0.0, width: dimensions.cgSize.width))
|
||||||
var callbacks = CTRunDelegateCallbacks(version: kCTRunDelegateVersion1, dealloc: { (pointer) in
|
var callbacks = CTRunDelegateCallbacks(version: kCTRunDelegateVersion1, dealloc: { (pointer) in
|
||||||
}, getAscent: { (pointer) -> CGFloat in
|
}, getAscent: { (pointer) -> CGFloat in
|
||||||
let d = pointer.assumingMemoryBound(to: RunStruct.self)
|
let d = pointer.assumingMemoryBound(to: RunStruct.self)
|
||||||
|
@ -388,7 +388,7 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode {
|
|||||||
if let thumbnailItem = thumbnailItem {
|
if let thumbnailItem = thumbnailItem {
|
||||||
switch thumbnailItem {
|
switch thumbnailItem {
|
||||||
case let .still(representation):
|
case let .still(representation):
|
||||||
let stillImageSize = representation.dimensions.aspectFitted(imageBoundingSize)
|
let stillImageSize = representation.dimensions.cgSize.aspectFitted(imageBoundingSize)
|
||||||
imageSize = stillImageSize
|
imageSize = stillImageSize
|
||||||
|
|
||||||
if fileUpdated {
|
if fileUpdated {
|
||||||
|
@ -209,6 +209,19 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func setReorderCompleted<T: ItemListNodeEntry>(_ f: @escaping ([T]) -> Void) {
|
||||||
|
self.reorderCompleted = { list in
|
||||||
|
f(list.map { $0 as! T })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private var reorderCompleted: (([ItemListNodeAnyEntry]) -> Void)? {
|
||||||
|
didSet {
|
||||||
|
if self.isNodeLoaded {
|
||||||
|
(self.displayNode as! ItemListControllerNode).reorderCompleted = self.reorderCompleted
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var previewItemWithTag: ((ItemListItemTag) -> UIViewController?)?
|
public var previewItemWithTag: ((ItemListItemTag) -> UIViewController?)?
|
||||||
public var commitPreview: ((UIViewController) -> Void)?
|
public var commitPreview: ((UIViewController) -> Void)?
|
||||||
|
|
||||||
@ -431,6 +444,7 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable
|
|||||||
displayNode.contentScrollingEnded = self.contentScrollingEnded
|
displayNode.contentScrollingEnded = self.contentScrollingEnded
|
||||||
displayNode.searchActivated = self.searchActivated
|
displayNode.searchActivated = self.searchActivated
|
||||||
displayNode.reorderEntry = self.reorderEntry
|
displayNode.reorderEntry = self.reorderEntry
|
||||||
|
displayNode.reorderCompleted = self.reorderCompleted
|
||||||
displayNode.listNode.experimentalSnapScrollToItem = self.experimentalSnapScrollToItem
|
displayNode.listNode.experimentalSnapScrollToItem = self.experimentalSnapScrollToItem
|
||||||
displayNode.requestLayout = { [weak self] transition in
|
displayNode.requestLayout = { [weak self] transition in
|
||||||
self?.requestLayout(transition: transition)
|
self?.requestLayout(transition: transition)
|
||||||
|
@ -216,6 +216,7 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
public var contentScrollingEnded: ((ListView) -> Bool)?
|
public var contentScrollingEnded: ((ListView) -> Bool)?
|
||||||
public var searchActivated: ((Bool) -> Void)?
|
public var searchActivated: ((Bool) -> Void)?
|
||||||
public var reorderEntry: ((Int, Int, [ItemListNodeAnyEntry]) -> Void)?
|
public var reorderEntry: ((Int, Int, [ItemListNodeAnyEntry]) -> Void)?
|
||||||
|
public var reorderCompleted: (([ItemListNodeAnyEntry]) -> Void)?
|
||||||
public var requestLayout: ((ContainedViewLayoutTransition) -> Void)?
|
public var requestLayout: ((ContainedViewLayoutTransition) -> Void)?
|
||||||
|
|
||||||
public var enableInteractiveDismiss = false {
|
public var enableInteractiveDismiss = false {
|
||||||
@ -272,6 +273,12 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
return .single(false)
|
return .single(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.listNode.reorderCompleted = { [weak self] opaqueTransactionState in
|
||||||
|
if let strongSelf = self, let reorderCompleted = strongSelf.reorderCompleted, let mergedEntries = (opaqueTransactionState as? ItemListNodeOpaqueState)?.mergedEntries {
|
||||||
|
reorderCompleted(mergedEntries)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.listNode.visibleBottomContentOffsetChanged = { [weak self] offset in
|
self.listNode.visibleBottomContentOffsetChanged = { [weak self] offset in
|
||||||
self?.visibleBottomContentOffsetChanged?(offset)
|
self?.visibleBottomContentOffsetChanged?(offset)
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
@interface TGAttachmentAssetCell ()
|
@interface TGAttachmentAssetCell ()
|
||||||
{
|
{
|
||||||
SMetaDisposable *_itemSelectedDisposable;
|
SMetaDisposable *_itemSelectedDisposable;
|
||||||
|
bool _ignoreSetSelected;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -126,14 +127,16 @@
|
|||||||
|
|
||||||
- (void)checkButtonPressed
|
- (void)checkButtonPressed
|
||||||
{
|
{
|
||||||
[_checkButton setSelected:!_checkButton.selected animated:true];
|
_ignoreSetSelected = true;
|
||||||
|
|
||||||
[self.selectionContext setItem:(id<TGMediaSelectableItem>)self.asset selected:_checkButton.selected animated:false sender:_checkButton];
|
[self.selectionContext setItem:(id<TGMediaSelectableItem>)self.asset selected:!_checkButton.selected animated:true sender:_checkButton];
|
||||||
|
|
||||||
bool value = [self.selectionContext isItemSelected:(id<TGMediaSelectableItem>)self.asset];
|
bool value = [self.selectionContext isItemSelected:(id<TGMediaSelectableItem>)self.asset];
|
||||||
if (value != _checkButton.selected) {
|
if (value != _checkButton.selected) {
|
||||||
[_checkButton setSelected:value animated:false];
|
[_checkButton setSelected:value animated:true];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ignoreSetSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setChecked:(bool)checked animated:(bool)animated
|
- (void)setChecked:(bool)checked animated:(bool)animated
|
||||||
|
@ -483,7 +483,7 @@ static CGAffineTransform TGCheckButtonDefaultTransform;
|
|||||||
{
|
{
|
||||||
_numberLabel = [[UILabel alloc] init];
|
_numberLabel = [[UILabel alloc] init];
|
||||||
_numberLabel.backgroundColor = [UIColor clearColor];
|
_numberLabel.backgroundColor = [UIColor clearColor];
|
||||||
_numberLabel.frame = CGRectMake(0.0f, -TGScreenPixel, _wrapperView.frame.size.width, _wrapperView.frame.size.height);
|
_numberLabel.frame = CGRectMake(0.0f, -TGScreenPixel, _wrapperView.bounds.size.width, _wrapperView.bounds.size.height);
|
||||||
_numberLabel.textColor = _checkColor;
|
_numberLabel.textColor = _checkColor;
|
||||||
_numberLabel.textAlignment = NSTextAlignmentCenter;
|
_numberLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
_numberLabel.userInteractionEnabled = false;
|
_numberLabel.userInteractionEnabled = false;
|
||||||
|
@ -258,9 +258,6 @@
|
|||||||
if (![[[LegacyComponentsGlobals provider] accessChecker] checkCameraAuthorizationStatusForIntent:TGCameraAccessIntentDefault alertDismissCompletion:nil])
|
if (![[[LegacyComponentsGlobals provider] accessChecker] checkCameraAuthorizationStatusForIntent:TGCameraAccessIntentDefault alertDismissCompletion:nil])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ([_context currentlyInSplitView])
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ([TGCameraController useLegacyCamera])
|
if ([TGCameraController useLegacyCamera])
|
||||||
{
|
{
|
||||||
[self _displayLegacyCamera];
|
[self _displayLegacyCamera];
|
||||||
|
@ -96,8 +96,7 @@
|
|||||||
|
|
||||||
- (void)checkButtonPressed
|
- (void)checkButtonPressed
|
||||||
{
|
{
|
||||||
[_checkButton setSelected:!_checkButton.selected animated:true];
|
[self.selectionContext setItem:(id<TGMediaSelectableItem>)self.item selected:!_checkButton.selected animated:false sender:_checkButton];
|
||||||
[self.selectionContext setItem:(id<TGMediaSelectableItem>)self.item selected:_checkButton.selected animated:false sender:_checkButton];
|
|
||||||
bool value = [self.selectionContext isItemSelected:(id<TGMediaSelectableItem>)self.item];
|
bool value = [self.selectionContext isItemSelected:(id<TGMediaSelectableItem>)self.item];
|
||||||
if (value != _checkButton.selected) {
|
if (value != _checkButton.selected) {
|
||||||
[_checkButton setSelected:value animated:true];
|
[_checkButton setSelected:value animated:true];
|
||||||
|
@ -264,6 +264,10 @@
|
|||||||
|
|
||||||
- (void)_adjustContentOffsetToBottom
|
- (void)_adjustContentOffsetToBottom
|
||||||
{
|
{
|
||||||
|
if (!self.isViewLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UIEdgeInsets contentInset = [self controllerInsetForInterfaceOrientation:self.interfaceOrientation];
|
UIEdgeInsets contentInset = [self controllerInsetForInterfaceOrientation:self.interfaceOrientation];
|
||||||
|
|
||||||
bool hasOnScreenNavigation = false;
|
bool hasOnScreenNavigation = false;
|
||||||
@ -308,6 +312,9 @@
|
|||||||
_collectionViewWidth = frame.size.width;
|
_collectionViewWidth = frame.size.width;
|
||||||
_collectionView.frame = frame;
|
_collectionView.frame = frame;
|
||||||
|
|
||||||
|
[_collectionView.collectionViewLayout invalidateLayout];
|
||||||
|
[_collectionView layoutSubviews];
|
||||||
|
|
||||||
if (lastInverseOffset < 45)
|
if (lastInverseOffset < 45)
|
||||||
{
|
{
|
||||||
[self _adjustContentOffsetToBottom];
|
[self _adjustContentOffsetToBottom];
|
||||||
@ -319,9 +326,6 @@
|
|||||||
CGPoint contentOffset = CGPointMake(0, -contentInset.top);
|
CGPoint contentOffset = CGPointMake(0, -contentInset.top);
|
||||||
[_collectionView setContentOffset:contentOffset animated:false];
|
[_collectionView setContentOffset:contentOffset animated:false];
|
||||||
}
|
}
|
||||||
|
|
||||||
[_collectionView.collectionViewLayout invalidateLayout];
|
|
||||||
[_collectionView layoutSubviews];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Gallery
|
#pragma mark - Gallery
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
|
|
||||||
TGModernButton *_muteButton;
|
TGModernButton *_muteButton;
|
||||||
TGCheckButtonView *_checkButton;
|
TGCheckButtonView *_checkButton;
|
||||||
|
bool _ignoreSetSelected;
|
||||||
TGMediaPickerPhotoCounterButton *_photoCounterButton;
|
TGMediaPickerPhotoCounterButton *_photoCounterButton;
|
||||||
TGMediaPickerGroupButton *_groupButton;
|
TGMediaPickerGroupButton *_groupButton;
|
||||||
TGMediaPickerCameraButton *_cameraButton;
|
TGMediaPickerCameraButton *_cameraButton;
|
||||||
@ -531,7 +532,9 @@
|
|||||||
if ([_currentItem conformsToProtocol:@protocol(TGModernGallerySelectableItem)])
|
if ([_currentItem conformsToProtocol:@protocol(TGModernGallerySelectableItem)])
|
||||||
selectableItem = ((id<TGModernGallerySelectableItem>)_currentItem).selectableMediaItem;
|
selectableItem = ((id<TGModernGallerySelectableItem>)_currentItem).selectableMediaItem;
|
||||||
|
|
||||||
|
if (!_ignoreSetSelected) {
|
||||||
[_checkButton setSelected:[_selectionContext isItemSelected:selectableItem] animated:false];
|
[_checkButton setSelected:[_selectionContext isItemSelected:selectableItem] animated:false];
|
||||||
|
}
|
||||||
[_checkButton setNumber:[_selectionContext indexOfItem:selectableItem]];
|
[_checkButton setNumber:[_selectionContext indexOfItem:selectableItem]];
|
||||||
signal = [_selectionContext itemInformativeSelectedSignal:selectableItem];
|
signal = [_selectionContext itemInformativeSelectedSignal:selectableItem];
|
||||||
[_itemSelectedDisposable setDisposable:[signal startWithNext:^(TGMediaSelectionChange *next)
|
[_itemSelectedDisposable setDisposable:[signal startWithNext:^(TGMediaSelectionChange *next)
|
||||||
@ -669,15 +672,17 @@
|
|||||||
if ([_currentItem conformsToProtocol:@protocol(TGModernGallerySelectableItem)])
|
if ([_currentItem conformsToProtocol:@protocol(TGModernGallerySelectableItem)])
|
||||||
selectableItem = ((id<TGModernGallerySelectableItem>)_currentItem).selectableMediaItem;
|
selectableItem = ((id<TGModernGallerySelectableItem>)_currentItem).selectableMediaItem;
|
||||||
|
|
||||||
[_checkButton setSelected:!_checkButton.selected animated:true];
|
_ignoreSetSelected = true;
|
||||||
|
|
||||||
if (selectableItem != nil) {
|
if (selectableItem != nil) {
|
||||||
[_selectionContext setItem:selectableItem selected:_checkButton.selected animated:animated sender:_checkButton];
|
[_selectionContext setItem:selectableItem selected:!_checkButton.selected animated:animated sender:_checkButton];
|
||||||
bool value = [_selectionContext isItemSelected:selectableItem];
|
bool value = [_selectionContext isItemSelected:selectableItem];
|
||||||
if (value != _checkButton.selected) {
|
|
||||||
[_checkButton setSelected:value animated:true];
|
[_checkButton setSelected:value animated:true];
|
||||||
|
} else {
|
||||||
|
[_checkButton setSelected:!_checkButton.selected animated:true];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_ignoreSetSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)photoCounterButtonPressed
|
- (void)photoCounterButtonPressed
|
||||||
|
@ -405,7 +405,7 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
if let resourcePath = resourcePath, let image = UIImage(contentsOfFile: resourcePath) {
|
if let resourcePath = resourcePath, let image = UIImage(contentsOfFile: resourcePath) {
|
||||||
dimensions = image.size
|
dimensions = image.size
|
||||||
}
|
}
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: dimensions, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(dimensions), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
if let image = UIImage(contentsOfFile: fullSizePath) {
|
if let image = UIImage(contentsOfFile: fullSizePath) {
|
||||||
let resource: TelegramMediaResource = LocalFileMediaResource(fileId: arc4random64())
|
let resource: TelegramMediaResource = LocalFileMediaResource(fileId: arc4random64())
|
||||||
copyLocalFiles.append((resource, fullSizePath))
|
copyLocalFiles.append((resource, fullSizePath))
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: image.size, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(image.size), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,14 +431,14 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
} else if imageUrl.hasPrefix("file://"), let path = URL(string: imageUrl)?.path {
|
} else if imageUrl.hasPrefix("file://"), let path = URL(string: imageUrl)?.path {
|
||||||
copyLocalFiles.append((resource, path))
|
copyLocalFiles.append((resource, path))
|
||||||
}
|
}
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: sizeValue.cgSizeValue, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(sizeValue.cgSizeValue), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var resource: TelegramMediaResource = LocalFileMediaResource(fileId: arc4random64())
|
var resource: TelegramMediaResource = LocalFileMediaResource(fileId: arc4random64())
|
||||||
|
|
||||||
var attributes: [TelegramMediaFileAttribute] = []
|
var attributes: [TelegramMediaFileAttribute] = []
|
||||||
attributes.append(.Video(duration: Int(item.duration), size: item.dimensions, flags: item.roundMessage ? .instantRoundVideo : []))
|
attributes.append(.Video(duration: Int(item.duration), size: PixelDimensions(item.dimensions), flags: item.roundMessage ? .instantRoundVideo : []))
|
||||||
|
|
||||||
var size: Int32 = 0
|
var size: Int32 = 0
|
||||||
if let videoUrl = item.videoInfo?.url(withQuality: 1, actualQuality: nil, actualSize: &size) {
|
if let videoUrl = item.videoInfo?.url(withQuality: 1, actualQuality: nil, actualSize: &size) {
|
||||||
@ -488,7 +488,7 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
resource = updatedResource
|
resource = updatedResource
|
||||||
copyLocalFiles.append((resource, pathFromLegacyImageUrl(basePath: basePath, url: imageUrl)))
|
copyLocalFiles.append((resource, pathFromLegacyImageUrl(basePath: basePath, url: imageUrl)))
|
||||||
}
|
}
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: sizeValue.cgSizeValue, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(sizeValue.cgSizeValue), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
} else if let _ = attribute as? TGDocumentAttributeAnimated {
|
} else if let _ = attribute as? TGDocumentAttributeAnimated {
|
||||||
attributes.append(.Animated)
|
attributes.append(.Animated)
|
||||||
} else if let attribute = attribute as? TGDocumentAttributeVideo {
|
} else if let attribute = attribute as? TGDocumentAttributeVideo {
|
||||||
attributes.append(.Video(duration: Int(attribute.duration), size: attribute.size, flags: attribute.isRoundMessage ? .instantRoundVideo : []))
|
attributes.append(.Video(duration: Int(attribute.duration), size: PixelDimensions(attribute.size), flags: attribute.isRoundMessage ? .instantRoundVideo : []))
|
||||||
} else if let attribute = attribute as? TGDocumentAttributeSticker {
|
} else if let attribute = attribute as? TGDocumentAttributeSticker {
|
||||||
var packReference: StickerPackReference?
|
var packReference: StickerPackReference?
|
||||||
if let reference = attribute.packReference as? TGStickerPackIdReference {
|
if let reference = attribute.packReference as? TGStickerPackIdReference {
|
||||||
@ -522,7 +522,7 @@ private func loadLegacyMessages(account: TemporaryAccount, basePath: String, acc
|
|||||||
}
|
}
|
||||||
attributes.append(.Sticker(displayText: attribute.alt ?? "", packReference: packReference, maskData: nil))
|
attributes.append(.Sticker(displayText: attribute.alt ?? "", packReference: packReference, maskData: nil))
|
||||||
} else if let attribute = attribute as? TGDocumentAttributeImageSize {
|
} else if let attribute = attribute as? TGDocumentAttributeImageSize {
|
||||||
attributes.append(.ImageSize(size: attribute.size))
|
attributes.append(.ImageSize(size: PixelDimensions(attribute.size)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,10 @@ func loadLegacyUser(database: SqliteInterface, id: Int32) -> (TelegramUser, Tele
|
|||||||
let photoBig = cursor.getString(at: 6)
|
let photoBig = cursor.getString(at: 6)
|
||||||
var photo: [TelegramMediaImageRepresentation] = []
|
var photo: [TelegramMediaImageRepresentation] = []
|
||||||
if let resource = resourceFromLegacyImageUrl(photoSmall) {
|
if let resource = resourceFromLegacyImageUrl(photoSmall) {
|
||||||
photo.append(TelegramMediaImageRepresentation(dimensions: CGSize(width: 80.0, height: 80.0), resource: resource))
|
photo.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: 80, height: 80), resource: resource))
|
||||||
}
|
}
|
||||||
if let resource = resourceFromLegacyImageUrl(photoBig) {
|
if let resource = resourceFromLegacyImageUrl(photoBig) {
|
||||||
photo.append(TelegramMediaImageRepresentation(dimensions: CGSize(width: 600.0, height: 600.0), resource: resource))
|
photo.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: 600, height: 600), resource: resource))
|
||||||
}
|
}
|
||||||
|
|
||||||
let user = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: cursor.getInt32(at: 0)), accessHash: accessHash == 0 ? nil : .personal(accessHash), firstName: firstName.isEmpty ? nil : firstName, lastName: lastName.isEmpty ? nil : lastName, username: username.isEmpty ? nil : username, phone: phone.isEmpty ? nil : phone, photo: photo, botInfo: nil, restrictionInfo: nil, flags: [])
|
let user = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: cursor.getInt32(at: 0)), accessHash: accessHash == 0 ? nil : .personal(accessHash), firstName: firstName.isEmpty ? nil : firstName, lastName: lastName.isEmpty ? nil : lastName, username: username.isEmpty ? nil : username, phone: phone.isEmpty ? nil : phone, photo: photo, botInfo: nil, restrictionInfo: nil, flags: [])
|
||||||
|
@ -238,7 +238,7 @@ public func legacyEnqueueGifMessage(account: Account, data: Data) -> Signal<Enqu
|
|||||||
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
||||||
let resource = LocalFileMediaResource(fileId: arc4random64())
|
let resource = LocalFileMediaResource(fileId: arc4random64())
|
||||||
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
||||||
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: thumbnailSize, resource: resource))
|
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(thumbnailSize), resource: resource))
|
||||||
}
|
}
|
||||||
|
|
||||||
var randomId: Int64 = 0
|
var randomId: Int64 = 0
|
||||||
@ -254,7 +254,7 @@ public func legacyEnqueueGifMessage(account: Account, data: Data) -> Signal<Enqu
|
|||||||
let finalDimensions = TGMediaVideoConverter.dimensions(for: dimensions, adjustments: nil, preset: TGMediaVideoConversionPresetAnimation)
|
let finalDimensions = TGMediaVideoConverter.dimensions(for: dimensions, adjustments: nil, preset: TGMediaVideoConversionPresetAnimation)
|
||||||
|
|
||||||
var fileAttributes: [TelegramMediaFileAttribute] = []
|
var fileAttributes: [TelegramMediaFileAttribute] = []
|
||||||
fileAttributes.append(.Video(duration: Int(0), size: finalDimensions, flags: [.supportsStreaming]))
|
fileAttributes.append(.Video(duration: Int(0), size: PixelDimensions(finalDimensions), flags: [.supportsStreaming]))
|
||||||
fileAttributes.append(.FileName(fileName: fileName))
|
fileAttributes.append(.FileName(fileName: fileName))
|
||||||
fileAttributes.append(.Animated)
|
fileAttributes.append(.Animated)
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ public func legacyAssetPickerEnqueueMessages(account: Account, signals: [Any]) -
|
|||||||
let thumbnailImage = TGScaleImageToPixelSize(thumbnail, thumbnailSize)!
|
let thumbnailImage = TGScaleImageToPixelSize(thumbnail, thumbnailSize)!
|
||||||
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
||||||
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: thumbnailSize, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(thumbnailSize), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch data {
|
switch data {
|
||||||
@ -316,7 +316,7 @@ public func legacyAssetPickerEnqueueMessages(account: Account, signals: [Any]) -
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
let resource = LocalFileReferenceMediaResource(localFilePath: tempFilePath, randomId: randomId)
|
let resource = LocalFileReferenceMediaResource(localFilePath: tempFilePath, randomId: randomId)
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: scaledSize, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(scaledSize), resource: resource))
|
||||||
|
|
||||||
let media = TelegramMediaImage(imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: randomId), representations: representations, immediateThumbnailData: nil, reference: nil, partialReference: nil)
|
let media = TelegramMediaImage(imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: randomId), representations: representations, immediateThumbnailData: nil, reference: nil, partialReference: nil)
|
||||||
var attributes: [MessageAttribute] = []
|
var attributes: [MessageAttribute] = []
|
||||||
@ -334,7 +334,7 @@ public func legacyAssetPickerEnqueueMessages(account: Account, signals: [Any]) -
|
|||||||
let size = CGSize(width: CGFloat(asset.pixelWidth), height: CGFloat(asset.pixelHeight))
|
let size = CGSize(width: CGFloat(asset.pixelWidth), height: CGFloat(asset.pixelHeight))
|
||||||
let scaledSize = size.aspectFittedOrSmaller(CGSize(width: 1280.0, height: 1280.0))
|
let scaledSize = size.aspectFittedOrSmaller(CGSize(width: 1280.0, height: 1280.0))
|
||||||
let resource = PhotoLibraryMediaResource(localIdentifier: asset.localIdentifier, uniqueId: arc4random64())
|
let resource = PhotoLibraryMediaResource(localIdentifier: asset.localIdentifier, uniqueId: arc4random64())
|
||||||
representations.append(TelegramMediaImageRepresentation(dimensions: scaledSize, resource: resource))
|
representations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(scaledSize), resource: resource))
|
||||||
|
|
||||||
let media = TelegramMediaImage(imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: randomId), representations: representations, immediateThumbnailData: nil, reference: nil, partialReference: nil)
|
let media = TelegramMediaImage(imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: randomId), representations: representations, immediateThumbnailData: nil, reference: nil, partialReference: nil)
|
||||||
var attributes: [MessageAttribute] = []
|
var attributes: [MessageAttribute] = []
|
||||||
@ -385,7 +385,7 @@ public func legacyAssetPickerEnqueueMessages(account: Account, signals: [Any]) -
|
|||||||
let thumbnailImage = TGScaleImageToPixelSize(thumbnail, thumbnailSize)!
|
let thumbnailImage = TGScaleImageToPixelSize(thumbnail, thumbnailSize)!
|
||||||
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
if let thumbnailData = thumbnailImage.jpegData(compressionQuality: 0.4) {
|
||||||
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
account.postbox.mediaBox.storeResourceData(resource.id, data: thumbnailData)
|
||||||
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: thumbnailSize, resource: resource))
|
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(thumbnailSize), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ public func legacyAssetPickerEnqueueMessages(account: Account, signals: [Any]) -
|
|||||||
fileAttributes.append(.Animated)
|
fileAttributes.append(.Animated)
|
||||||
}
|
}
|
||||||
if !asFile {
|
if !asFile {
|
||||||
fileAttributes.append(.Video(duration: Int(finalDuration), size: finalDimensions, flags: [.supportsStreaming]))
|
fileAttributes.append(.Video(duration: Int(finalDuration), size: PixelDimensions(finalDimensions), flags: [.supportsStreaming]))
|
||||||
if let adjustments = adjustments {
|
if let adjustments = adjustments {
|
||||||
if adjustments.sendAsGif {
|
if adjustments.sendAsGif {
|
||||||
fileAttributes.append(.Animated)
|
fileAttributes.append(.Animated)
|
||||||
|
@ -66,7 +66,7 @@ func legacyComponentsStickers(postbox: Postbox, namespace: Int32) -> SSignal {
|
|||||||
let encoder = PostboxEncoder()
|
let encoder = PostboxEncoder()
|
||||||
encoder.encodeRootObject(thumbnail.resource)
|
encoder.encodeRootObject(thumbnail.resource)
|
||||||
let dataString = encoder.makeData().base64EncodedString(options: [])
|
let dataString = encoder.makeData().base64EncodedString(options: [])
|
||||||
imageInfo.addImage(with: thumbnail.dimensions, url: dataString)
|
imageInfo.addImage(with: thumbnail.dimensions.cgSize, url: dataString)
|
||||||
document.thumbnailInfo = imageInfo
|
document.thumbnailInfo = imageInfo
|
||||||
}
|
}
|
||||||
var attributes: [Any] = []
|
var attributes: [Any] = []
|
||||||
@ -77,7 +77,7 @@ func legacyComponentsStickers(postbox: Postbox, namespace: Int32) -> SSignal {
|
|||||||
return TGStickerMaskDescription(n: $0.n, point: CGPoint(x: CGFloat($0.x), y: CGFloat($0.y)), zoom: CGFloat($0.zoom))
|
return TGStickerMaskDescription(n: $0.n, point: CGPoint(x: CGFloat($0.x), y: CGFloat($0.y)), zoom: CGFloat($0.zoom))
|
||||||
}))
|
}))
|
||||||
case let .ImageSize(size):
|
case let .ImageSize(size):
|
||||||
attributes.append(TGDocumentAttributeImageSize(size: size))
|
attributes.append(TGDocumentAttributeImageSize(size: size.cgSize))
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ final class LegacyStickerImageDataSource: TGImageDataSource {
|
|||||||
var previewRepresentations: [TelegramMediaImageRepresentation] = []
|
var previewRepresentations: [TelegramMediaImageRepresentation] = []
|
||||||
if let legacyThumbnailUri = args["legacyThumbnailUri"] as? String, let data = Data(base64Encoded: legacyThumbnailUri, options: []) {
|
if let legacyThumbnailUri = args["legacyThumbnailUri"] as? String, let data = Data(base64Encoded: legacyThumbnailUri, options: []) {
|
||||||
if let resource = PostboxDecoder(buffer: MemoryBuffer(data: data)).decodeRootObject() as? TelegramMediaResource {
|
if let resource = PostboxDecoder(buffer: MemoryBuffer(data: data)).decodeRootObject() as? TelegramMediaResource {
|
||||||
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: CGSize(width: 140.0, height: 140.0), resource: resource))
|
previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: PixelDimensions(width: 140, height: 140), resource: resource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import SwiftSignalKit
|
|||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SyncCore
|
import SyncCore
|
||||||
import SyncCore
|
|
||||||
import Display
|
import Display
|
||||||
|
|
||||||
public func mapResourceToAvatarSizes(postbox: Postbox, resource: MediaResource, representations: [TelegramMediaImageRepresentation]) -> Signal<[Int: Data], NoError> {
|
public func mapResourceToAvatarSizes(postbox: Postbox, resource: MediaResource, representations: [TelegramMediaImageRepresentation]) -> Signal<[Int: Data], NoError> {
|
||||||
@ -16,7 +15,7 @@ public func mapResourceToAvatarSizes(postbox: Postbox, resource: MediaResource,
|
|||||||
}
|
}
|
||||||
var result: [Int: Data] = [:]
|
var result: [Int: Data] = [:]
|
||||||
for i in 0 ..< representations.count {
|
for i in 0 ..< representations.count {
|
||||||
if let scaledImage = generateScaledImage(image: image, size: representations[i].dimensions, scale: 1.0), let scaledData = scaledImage.jpegData(compressionQuality: 0.8) {
|
if let scaledImage = generateScaledImage(image: image, size: representations[i].dimensions.cgSize, scale: 1.0), let scaledData = scaledImage.jpegData(compressionQuality: 0.8) {
|
||||||
result[i] = scaledData
|
result[i] = scaledData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -335,6 +335,8 @@ private final class AudioPlayerRendererContext {
|
|||||||
assert(audioPlayerRendererQueue.isCurrent())
|
assert(audioPlayerRendererQueue.isCurrent())
|
||||||
|
|
||||||
if self.audioGraph == nil {
|
if self.audioGraph == nil {
|
||||||
|
let startTime = CFAbsoluteTimeGetCurrent()
|
||||||
|
|
||||||
var maybeAudioGraph: AUGraph?
|
var maybeAudioGraph: AUGraph?
|
||||||
guard NewAUGraph(&maybeAudioGraph) == noErr, let audioGraph = maybeAudioGraph else {
|
guard NewAUGraph(&maybeAudioGraph) == noErr, let audioGraph = maybeAudioGraph else {
|
||||||
return
|
return
|
||||||
@ -428,6 +430,8 @@ private final class AudioPlayerRendererContext {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("MediaPlayerAudioRenderer initialize audio unit: \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
||||||
|
|
||||||
self.audioGraph = audioGraph
|
self.audioGraph = audioGraph
|
||||||
self.timePitchAudioUnit = timePitchAudioUnit
|
self.timePitchAudioUnit = timePitchAudioUnit
|
||||||
self.outputAudioUnit = outputAudioUnit
|
self.outputAudioUnit = outputAudioUnit
|
||||||
@ -497,10 +501,14 @@ private final class AudioPlayerRendererContext {
|
|||||||
assert(audioPlayerRendererQueue.isCurrent())
|
assert(audioPlayerRendererQueue.isCurrent())
|
||||||
|
|
||||||
if let audioGraph = self.audioGraph {
|
if let audioGraph = self.audioGraph {
|
||||||
|
let startTime = CFAbsoluteTimeGetCurrent()
|
||||||
|
|
||||||
guard AUGraphStart(audioGraph) == noErr else {
|
guard AUGraphStart(audioGraph) == noErr else {
|
||||||
self.closeAudioUnit()
|
self.closeAudioUnit()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("MediaPlayerAudioRenderer start audio unit: \((CFAbsoluteTimeGetCurrent() - startTime) * 1000.0) ms")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,8 +847,8 @@ public final class MediaPlayerScrubbingNode: ASDisplayNode {
|
|||||||
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||||
switch self.contentNodes {
|
switch self.contentNodes {
|
||||||
case let .standard(node):
|
case let .standard(node):
|
||||||
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled, handleNodeContainer.frame.insetBy(dx: 0.0, dy: -5.0).contains(point) {
|
if let handleNodeContainer = node.handleNodeContainer, handleNodeContainer.isUserInteractionEnabled, handleNodeContainer.frame.insetBy(dx: 0.0, dy: -16.0).contains(point) {
|
||||||
if let handleNode = node.handleNode, handleNode.convert(handleNode.bounds, to: self).insetBy(dx: -16.0, dy: -16.0).contains(point) {
|
if let handleNode = node.handleNode, handleNode.convert(handleNode.bounds, to: self).insetBy(dx: -32.0, dy: -16.0).contains(point) {
|
||||||
return handleNodeContainer.view
|
return handleNodeContainer.view
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTEncryption.h>
|
||||||
# import <MTProtoKitDynamic/MTEncryption.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTEncryption.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTEncryption.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void MyAesIgeEncrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv);
|
void MyAesIgeEncrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv);
|
||||||
void MyAesIgeDecrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv);
|
void MyAesIgeDecrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv);
|
||||||
|
@ -1,48 +1,18 @@
|
|||||||
#import "MTBackupAddressSignals.h"
|
#import "MTBackupAddressSignals.h"
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
#import <MtProtoKit/MTQueue.h>
|
||||||
# import <MTProtoKitDynamic/MTQueue.h>
|
#import <MtProtoKit/MTHttpRequestOperation.h>
|
||||||
# import <MTProtoKitDynamic/MTHttpRequestOperation.h>
|
#import <MtProtoKit/MTEncryption.h>
|
||||||
# import <MTProtoKitDynamic/MTEncryption.h>
|
#import <MtProtoKit/MTRequestMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTRequestMessageService.h>
|
#import <MtProtoKit/MTRequest.h>
|
||||||
# import <MTProtoKitDynamic/MTRequest.h>
|
#import <MtProtoKit/MTContext.h>
|
||||||
# import <MTProtoKitDynamic/MTContext.h>
|
#import <MtProtoKit/MTApiEnvironment.h>
|
||||||
# import <MTProtoKitDynamic/MTApiEnvironment.h>
|
#import <MtProtoKit/MTDatacenterAddress.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddress.h>
|
#import <MtProtoKit/MTDatacenterAddressSet.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddressSet.h>
|
#import <MtProtoKit/MTProto.h>
|
||||||
# import <MTProtoKitDynamic/MTProto.h>
|
#import <MtProtoKit/MTSerialization.h>
|
||||||
# import <MTProtoKitDynamic/MTSerialization.h>
|
#import <MtProtoKit/MTLogging.h>
|
||||||
# import <MTProtoKitDynamic/MTLogging.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
# import <MTProtoKitMac/MTQueue.h>
|
|
||||||
# import <MTProtoKitMac/MTHttpRequestOperation.h>
|
|
||||||
# import <MTProtoKitMac/MTEncryption.h>
|
|
||||||
# import <MTProtoKitMac/MTRequestMessageService.h>
|
|
||||||
# import <MTProtoKitMac/MTRequest.h>
|
|
||||||
# import <MTProtoKitMac/MTContext.h>
|
|
||||||
# import <MTProtoKitMac/MTApiEnvironment.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddress.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddressSet.h>
|
|
||||||
# import <MTProtoKitMac/MTProto.h>
|
|
||||||
# import <MTProtoKitMac/MTSerialization.h>
|
|
||||||
# import <MTProtoKitMac/MTLogging.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
# import <MtProtoKit/MTQueue.h>
|
|
||||||
# import <MtProtoKit/MTHttpRequestOperation.h>
|
|
||||||
# import <MtProtoKit/MTEncryption.h>
|
|
||||||
# import <MtProtoKit/MTRequestMessageService.h>
|
|
||||||
# import <MtProtoKit/MTRequest.h>
|
|
||||||
# import <MtProtoKit/MTContext.h>
|
|
||||||
# import <MtProtoKit/MTApiEnvironment.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddress.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddressSet.h>
|
|
||||||
# import <MtProtoKit/MTProto.h>
|
|
||||||
# import <MtProtoKit/MTSerialization.h>
|
|
||||||
# import <MtProtoKit/MTLogging.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static NSData *base64_decode(NSString *str) {
|
static NSData *base64_decode(NSString *str) {
|
||||||
if ([NSData instancesRespondToSelector:@selector(initWithBase64EncodedString:options:)]) {
|
if ([NSData instancesRespondToSelector:@selector(initWithBase64EncodedString:options:)]) {
|
||||||
|
@ -1,54 +1,20 @@
|
|||||||
#import "MTConnectionProbing.h"
|
#import "MTConnectionProbing.h"
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
#import <MtProtoKit/MTQueue.h>
|
||||||
# import <MTProtoKitDynamic/MTQueue.h>
|
#import <MtProtoKit/MTAtomic.h>
|
||||||
# import <MTProtoKitDynamic/MTAtomic.h>
|
#import <MtProtoKit/MTHttpRequestOperation.h>
|
||||||
# import <MTProtoKitDynamic/MTHttpRequestOperation.h>
|
#import <MtProtoKit/MTEncryption.h>
|
||||||
# import <MTProtoKitDynamic/MTEncryption.h>
|
#import <MtProtoKit/MTRequestMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTRequestMessageService.h>
|
#import <MtProtoKit/MTRequest.h>
|
||||||
# import <MTProtoKitDynamic/MTRequest.h>
|
#import <MtProtoKit/MTContext.h>
|
||||||
# import <MTProtoKitDynamic/MTContext.h>
|
#import <MtProtoKit/MTApiEnvironment.h>
|
||||||
# import <MTProtoKitDynamic/MTApiEnvironment.h>
|
#import <MtProtoKit/MTDatacenterAddress.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddress.h>
|
#import <MtProtoKit/MTDatacenterAddressSet.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddressSet.h>
|
#import <MtProtoKit/MTProto.h>
|
||||||
# import <MTProtoKitDynamic/MTProto.h>
|
#import <MtProtoKit/MTSerialization.h>
|
||||||
# import <MTProtoKitDynamic/MTSerialization.h>
|
#import <MtProtoKit/MTLogging.h>
|
||||||
# import <MTProtoKitDynamic/MTLogging.h>
|
#import <MtProtoKit/MTProxyConnectivity.h>
|
||||||
# import <MTProtoKitDynamic/MTProxyConnectivity.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
# import <MTProtoKitMac/MTQueue.h>
|
|
||||||
# import <MTProtoKitMac/MTAtomic.h>
|
|
||||||
# import <MTProtoKitMac/MTHttpRequestOperation.h>
|
|
||||||
# import <MTProtoKitMac/MTEncryption.h>
|
|
||||||
# import <MTProtoKitMac/MTRequestMessageService.h>
|
|
||||||
# import <MTProtoKitMac/MTRequest.h>
|
|
||||||
# import <MTProtoKitMac/MTContext.h>
|
|
||||||
# import <MTProtoKitMac/MTApiEnvironment.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddress.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddressSet.h>
|
|
||||||
# import <MTProtoKitMac/MTProto.h>
|
|
||||||
# import <MTProtoKitMac/MTSerialization.h>
|
|
||||||
# import <MTProtoKitMac/MTLogging.h>
|
|
||||||
# import <MTProtoKitMac/MTProxyConnectivity.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
# import <MtProtoKit/MTQueue.h>
|
|
||||||
# import <MtProtoKit/MTAtomic.h>
|
|
||||||
# import <MtProtoKit/MTHttpRequestOperation.h>
|
|
||||||
# import <MtProtoKit/MTEncryption.h>
|
|
||||||
# import <MtProtoKit/MTRequestMessageService.h>
|
|
||||||
# import <MtProtoKit/MTRequest.h>
|
|
||||||
# import <MtProtoKit/MTContext.h>
|
|
||||||
# import <MtProtoKit/MTApiEnvironment.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddress.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddressSet.h>
|
|
||||||
# import <MtProtoKit/MTProto.h>
|
|
||||||
# import <MtProtoKit/MTSerialization.h>
|
|
||||||
# import <MtProtoKit/MTLogging.h>
|
|
||||||
# import <MtProtoKit/MTProxyConnectivity.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import "PingFoundation.h"
|
#import "PingFoundation.h"
|
||||||
|
|
||||||
|
@ -8,55 +8,21 @@
|
|||||||
#import <netinet/in.h>
|
#import <netinet/in.h>
|
||||||
#import <net/if.h>
|
#import <net/if.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTQueue.h>
|
||||||
# import <MTProtoKitDynamic/MTQueue.h>
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
#import <MtProtoKit/MTBag.h>
|
||||||
# import <MTProtoKitDynamic/MTBag.h>
|
#import <MtProtoKit/MTAtomic.h>
|
||||||
# import <MTProtoKitDynamic/MTAtomic.h>
|
#import <MtProtoKit/MTHttpRequestOperation.h>
|
||||||
# import <MTProtoKitDynamic/MTHttpRequestOperation.h>
|
#import <MtProtoKit/MTEncryption.h>
|
||||||
# import <MTProtoKitDynamic/MTEncryption.h>
|
#import <MtProtoKit/MTRequestMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTRequestMessageService.h>
|
#import <MtProtoKit/MTRequest.h>
|
||||||
# import <MTProtoKitDynamic/MTRequest.h>
|
#import <MtProtoKit/MTContext.h>
|
||||||
# import <MTProtoKitDynamic/MTContext.h>
|
#import <MtProtoKit/MTApiEnvironment.h>
|
||||||
# import <MTProtoKitDynamic/MTApiEnvironment.h>
|
#import <MtProtoKit/MTDatacenterAddress.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddress.h>
|
#import <MtProtoKit/MTDatacenterAddressSet.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddressSet.h>
|
#import <MtProtoKit/MTProto.h>
|
||||||
# import <MTProtoKitDynamic/MTProto.h>
|
#import <MtProtoKit/MTSerialization.h>
|
||||||
# import <MTProtoKitDynamic/MTSerialization.h>
|
#import <MtProtoKit/MTLogging.h>
|
||||||
# import <MTProtoKitDynamic/MTLogging.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTQueue.h>
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
# import <MTProtoKitMac/MTBag.h>
|
|
||||||
# import <MTProtoKitMac/MTAtomic.h>
|
|
||||||
# import <MTProtoKitMac/MTHttpRequestOperation.h>
|
|
||||||
# import <MTProtoKitMac/MTEncryption.h>
|
|
||||||
# import <MTProtoKitMac/MTRequestMessageService.h>
|
|
||||||
# import <MTProtoKitMac/MTRequest.h>
|
|
||||||
# import <MTProtoKitMac/MTContext.h>
|
|
||||||
# import <MTProtoKitMac/MTApiEnvironment.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddress.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddressSet.h>
|
|
||||||
# import <MTProtoKitMac/MTProto.h>
|
|
||||||
# import <MTProtoKitMac/MTSerialization.h>
|
|
||||||
# import <MTProtoKitMac/MTLogging.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTQueue.h>
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
# import <MtProtoKit/MTBag.h>
|
|
||||||
# import <MtProtoKit/MTAtomic.h>
|
|
||||||
# import <MtProtoKit/MTHttpRequestOperation.h>
|
|
||||||
# import <MtProtoKit/MTEncryption.h>
|
|
||||||
# import <MtProtoKit/MTRequestMessageService.h>
|
|
||||||
# import <MtProtoKit/MTRequest.h>
|
|
||||||
# import <MtProtoKit/MTContext.h>
|
|
||||||
# import <MtProtoKit/MTApiEnvironment.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddress.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddressSet.h>
|
|
||||||
# import <MtProtoKit/MTProto.h>
|
|
||||||
# import <MtProtoKit/MTSerialization.h>
|
|
||||||
# import <MtProtoKit/MTLogging.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <netinet/in.h>
|
#import <netinet/in.h>
|
||||||
#import <arpa/inet.h>
|
#import <arpa/inet.h>
|
||||||
|
@ -3,25 +3,11 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#import <libkern/OSAtomic.h>
|
#import <libkern/OSAtomic.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTNetworkUsageCalculationInfo.h>
|
||||||
# import <MTProtoKitDynamic/MTNetworkUsageCalculationInfo.h>
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
#import <MtProtoKit/MTTimer.h>
|
||||||
# import <MTProtoKitDynamic/MTTimer.h>
|
#import <MtProtoKit/MTQueue.h>
|
||||||
# import <MTProtoKitDynamic/MTQueue.h>
|
#import <MtProtoKit/MTAtomic.h>
|
||||||
# import <MTProtoKitDynamic/MTAtomic.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTNetworkUsageCalculationInfo.h>
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
# import <MTProtoKitMac/MTTimer.h>
|
|
||||||
# import <MTProtoKitMac/MTQueue.h>
|
|
||||||
# import <MTProtoKitMac/MTAtomic.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTNetworkUsageCalculationInfo.h>
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
# import <MtProtoKit/MTTimer.h>
|
|
||||||
# import <MtProtoKit/MTQueue.h>
|
|
||||||
# import <MtProtoKit/MTAtomic.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int offsetForInterface(MTNetworkUsageCalculationInfo *info, MTNetworkUsageManagerInterface interface, bool incoming) {
|
static int offsetForInterface(MTNetworkUsageCalculationInfo *info, MTNetworkUsageManagerInterface interface, bool incoming) {
|
||||||
switch (interface) {
|
switch (interface) {
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTDatacenterAuthInfo.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAuthInfo.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAuthInfo.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTDatacenterAuthInfo.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <EncryptionProvider/EncryptionProvider.h>
|
#import <EncryptionProvider/EncryptionProvider.h>
|
||||||
|
|
||||||
|
@ -29,16 +29,8 @@
|
|||||||
|
|
||||||
#import "MTTransportSchemeStats.h"
|
#import "MTTransportSchemeStats.h"
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTDisposable.h>
|
||||||
# import <MTProtoKitDynamic/MTDisposable.h>
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTDisposable.h>
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTDisposable.h>
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@implementation MTContextBlockChangeListener
|
@implementation MTContextBlockChangeListener
|
||||||
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTDatacenterAuthInfo.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAuthInfo.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAuthInfo.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTDatacenterAuthInfo.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@class MTContext;
|
@class MTContext;
|
||||||
@class MTDatacenterAuthAction;
|
@class MTDatacenterAuthAction;
|
||||||
|
@ -10,13 +10,8 @@
|
|||||||
#import "MTSerialization.h"
|
#import "MTSerialization.h"
|
||||||
#import "MTDatacenterAddressSet.h"
|
#import "MTDatacenterAddressSet.h"
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import "MTDatacenterAuthMessageService.h"
|
#import "MTDatacenterAuthMessageService.h"
|
||||||
#import "MTRequestMessageService.h"
|
#import "MTRequestMessageService.h"
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTMessageService.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTMessageService.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@class MTContext;
|
@class MTContext;
|
||||||
@class MTDatacenterAuthMessageService;
|
@class MTDatacenterAuthMessageService;
|
||||||
|
@ -402,8 +402,7 @@ typedef enum {
|
|||||||
arc4random_buf(&random, 1);
|
arc4random_buf(&random, 1);
|
||||||
[dataWithHash appendBytes:&random length:1];
|
[dataWithHash appendBytes:&random length:1];
|
||||||
}
|
}
|
||||||
|
NSData *encryptedData = MTRsaEncrypt(_encryptionProvider, [publicKey objectForKey:@"key"], dataWithHash);
|
||||||
NSData *encryptedData = MTRsaEncrypt([publicKey objectForKey:@"key"], dataWithHash);
|
|
||||||
if (encryptedData.length < 256)
|
if (encryptedData.length < 256)
|
||||||
{
|
{
|
||||||
NSMutableData *newEncryptedData = [[NSMutableData alloc] init];
|
NSMutableData *newEncryptedData = [[NSMutableData alloc] init];
|
||||||
@ -440,7 +439,7 @@ typedef enum {
|
|||||||
[dataWithHash appendBytes:&random length:1];
|
[dataWithHash appendBytes:&random length:1];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData *encryptedData = MTRsaEncrypt([publicKey objectForKey:@"key"], dataWithHash);
|
NSData *encryptedData = MTRsaEncrypt(_encryptionProvider, [publicKey objectForKey:@"key"], dataWithHash);
|
||||||
if (encryptedData.length < 256)
|
if (encryptedData.length < 256)
|
||||||
{
|
{
|
||||||
NSMutableData *newEncryptedData = [[NSMutableData alloc] init];
|
NSMutableData *newEncryptedData = [[NSMutableData alloc] init];
|
||||||
|
@ -28,7 +28,7 @@ void MTAesDecryptInplaceAndModifyIv(NSMutableData *data, NSData *key, NSMutableD
|
|||||||
void MTAesDecryptBytesInplaceAndModifyIv(void *data, NSInteger length, NSData *key, void *iv);
|
void MTAesDecryptBytesInplaceAndModifyIv(void *data, NSInteger length, NSData *key, void *iv);
|
||||||
NSData *MTAesEncrypt(NSData *data, NSData *key, NSData *iv);
|
NSData *MTAesEncrypt(NSData *data, NSData *key, NSData *iv);
|
||||||
NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv);
|
NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv);
|
||||||
NSData *MTRsaEncrypt(NSString *publicKey, NSData *data);
|
NSData *MTRsaEncrypt(id<EncryptionProvider> provider, NSString *publicKey, NSData *data);
|
||||||
NSData *MTExp(id<EncryptionProvider> provider, NSData *base, NSData *exp, NSData *modulus);
|
NSData *MTExp(id<EncryptionProvider> provider, NSData *base, NSData *exp, NSData *modulus);
|
||||||
NSData *MTModSub(id<EncryptionProvider> provider, NSData *a, NSData *b, NSData *modulus);
|
NSData *MTModSub(id<EncryptionProvider> provider, NSData *a, NSData *b, NSData *modulus);
|
||||||
NSData *MTModMul(id<EncryptionProvider> provider, NSData *a, NSData *b, NSData *modulus);
|
NSData *MTModMul(id<EncryptionProvider> provider, NSData *a, NSData *b, NSData *modulus);
|
||||||
|
@ -291,7 +291,7 @@ NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv)
|
|||||||
return resultData;
|
return resultData;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData *MTRsaEncrypt(NSString *publicKey, NSData *data)
|
NSData *MTRsaEncrypt(id<EncryptionProvider> provider, NSString *publicKey, NSData *data)
|
||||||
{
|
{
|
||||||
#if TARGET_OS_IOS
|
#if TARGET_OS_IOS
|
||||||
NSMutableData *updatedData = [[NSMutableData alloc] initWithData:data];
|
NSMutableData *updatedData = [[NSMutableData alloc] initWithData:data];
|
||||||
@ -301,32 +301,7 @@ NSData *MTRsaEncrypt(NSString *publicKey, NSData *data)
|
|||||||
}
|
}
|
||||||
return [MTRsa encryptData:updatedData publicKey:publicKey];
|
return [MTRsa encryptData:updatedData publicKey:publicKey];
|
||||||
#else
|
#else
|
||||||
BIO *keyBio = BIO_new(BIO_s_mem());
|
return [provider macosRSAEncrypt:publicKey data:data];
|
||||||
const char *keyData = [publicKey UTF8String];
|
|
||||||
BIO_write(keyBio, keyData, (int)publicKey.length);
|
|
||||||
RSA *rsaKey = PEM_read_bio_RSAPublicKey(keyBio, NULL, NULL, NULL);
|
|
||||||
BIO_free(keyBio);
|
|
||||||
|
|
||||||
BN_CTX *ctx = BN_CTX_new();
|
|
||||||
BIGNUM *a = BN_bin2bn(data.bytes, (int)data.length, NULL);
|
|
||||||
BIGNUM *r = BN_new();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BN_mod_exp(r, a, RSA_get0_e(rsaKey), RSA_get0_n(rsaKey), ctx);
|
|
||||||
|
|
||||||
unsigned char *res = malloc((size_t)BN_num_bytes(r));
|
|
||||||
int resLen = BN_bn2bin(r, res);
|
|
||||||
|
|
||||||
BN_CTX_free(ctx);
|
|
||||||
BN_free(a);
|
|
||||||
BN_free(r);
|
|
||||||
|
|
||||||
RSA_free(rsaKey);
|
|
||||||
|
|
||||||
NSData *result = [[NSData alloc] initWithBytesNoCopy:res length:(NSUInteger)resLen freeWhenDone:true];
|
|
||||||
|
|
||||||
return result;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTKeychain.h>
|
||||||
# import <MTProtoKitDynamic/MTKeychain.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTKeychain.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTKeychain.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@ -1,17 +1,8 @@
|
|||||||
#import "MTHttpRequestOperation.h"
|
#import "MTHttpRequestOperation.h"
|
||||||
|
|
||||||
#import "../thirdparty/AFNetworking/AFHTTPRequestOperation.h"
|
#import "../thirdparty/AFNetworking/AFHTTPRequestOperation.h"
|
||||||
|
#import <MtProtoKit/MTDisposable.h>
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTDisposable.h>
|
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTDisposable.h>
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTDisposable.h>
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@implementation MTHttpRequestOperation
|
@implementation MTHttpRequestOperation
|
||||||
|
|
||||||
|
@ -56,16 +56,8 @@
|
|||||||
|
|
||||||
#import "MTTime.h"
|
#import "MTTime.h"
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTSignal.h>
|
||||||
# import <MTProtoKitDynamic/MTSignal.h>
|
#import <MtProtoKit/MTQueue.h>
|
||||||
# import <MTProtoKitDynamic/MTQueue.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTSignal.h>
|
|
||||||
# import <MTProtoKitMac/MTQueue.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTSignal.h>
|
|
||||||
# import <MtProtoKit/MTQueue.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MTProtoStateAwaitingDatacenterScheme = 1,
|
MTProtoStateAwaitingDatacenterScheme = 1,
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTMessageService.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTMessageService.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@class MTContext;
|
@class MTContext;
|
||||||
@class MTRequest;
|
@class MTRequest;
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTMessageService.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTMessageService.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@class MTResendMessageService;
|
@class MTResendMessageService;
|
||||||
|
|
||||||
|
@ -2,19 +2,9 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTExportedAuthorizationData.h>
|
||||||
# import <MTProtoKitDynamic/MTExportedAuthorizationData.h>
|
#import <MtProtoKit/MTDatacenterAddressListData.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterAddressListData.h>
|
#import <MtProtoKit/MTDatacenterVerificationData.h>
|
||||||
# import <MTProtoKitDynamic/MTDatacenterVerificationData.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTExportedAuthorizationData.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterAddressListData.h>
|
|
||||||
# import <MTProtoKitMac/MTDatacenterVerificationData.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTExportedAuthorizationData.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterAddressListData.h>
|
|
||||||
# import <MtProtoKit/MTDatacenterVerificationData.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef MTExportedAuthorizationData *(^MTExportAuthorizationResponseParser)(NSData *);
|
typedef MTExportedAuthorizationData *(^MTExportAuthorizationResponseParser)(NSData *);
|
||||||
typedef MTDatacenterAddressListData *(^MTRequestDatacenterAddressListParser)(NSData *);
|
typedef MTDatacenterAddressListData *(^MTRequestDatacenterAddressListParser)(NSData *);
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTTransport.h>
|
||||||
# import <MTProtoKitDynamic/MTTransport.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTTransport.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTTransport.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface MTTcpTransport : MTTransport
|
@interface MTTcpTransport : MTTransport
|
||||||
|
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
|
|
||||||
|
#import <MtProtoKit/MTMessageService.h>
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
|
||||||
# import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTMessageService.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTMessageService.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@class MTTimeSyncMessageService;
|
@class MTTimeSyncMessageService;
|
||||||
|
|
||||||
|
@ -12,13 +12,8 @@
|
|||||||
@class MTNetworkUsageCalculationInfo;
|
@class MTNetworkUsageCalculationInfo;
|
||||||
@class MTSocksProxySettings;
|
@class MTSocksProxySettings;
|
||||||
|
|
||||||
#if defined(MtProtoKitDynamicFramework)
|
#import <MtProtoKit/MTMessageService.h>
|
||||||
# import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#elif defined(MtProtoKitMacFramework)
|
|
||||||
# import <MTProtoKitMac/MTMessageService.h>
|
|
||||||
#else
|
|
||||||
# import <MtProtoKit/MTMessageService.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@protocol MTTransportDelegate <NSObject>
|
@protocol MTTransportDelegate <NSObject>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
#if TARGET_OS_IOS
|
||||||
@interface MTRsa : NSObject
|
@interface MTRsa : NSObject
|
||||||
|
|
||||||
// return base64 encoded string
|
// return base64 encoded string
|
||||||
@ -19,3 +19,4 @@
|
|||||||
+ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey;
|
+ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Security/Security.h>
|
#import <Security/Security.h>
|
||||||
|
#if TARGET_OS_IOS
|
||||||
@implementation MTRsa
|
@implementation MTRsa
|
||||||
|
|
||||||
NSString *MTStringByEncodingInBase64(NSData *data) {
|
NSString *MTStringByEncodingInBase64(NSData *data) {
|
||||||
@ -439,3 +439,4 @@ static NSData *base64_decode(NSString *str) {
|
|||||||
/* END: Encryption & Decryption with RSA public key */
|
/* END: Encryption & Decryption with RSA public key */
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string></string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,79 +0,0 @@
|
|||||||
//
|
|
||||||
// MtProtoKitDynamic.h
|
|
||||||
// MtProtoKitDynamic
|
|
||||||
//
|
|
||||||
// Created by Peter on 08/07/15.
|
|
||||||
// Copyright (c) 2015 Telegram. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
//! Project version number for MtProtoKitDynamic.
|
|
||||||
FOUNDATION_EXPORT double MtProtoKitDynamicVersionNumber;
|
|
||||||
|
|
||||||
//! Project version string for MtProtoKitDynamic.
|
|
||||||
FOUNDATION_EXPORT const unsigned char MtProtoKitDynamicVersionString[];
|
|
||||||
|
|
||||||
#ifndef MtProtoKitDynamicFramework
|
|
||||||
# define MtProtoKitDynamicFramework 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <MTProtoKitDynamic/MTTime.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTimer.h>
|
|
||||||
#import <MTProtoKitDynamic/MTLogging.h>
|
|
||||||
#import <MTProtoKitDynamic/MTEncryption.h>
|
|
||||||
#import <MTProtoKitDynamic/MTInternalId.h>
|
|
||||||
#import <MTProtoKitDynamic/MTQueue.h>
|
|
||||||
#import <MTProtoKitDynamic/MTOutputStream.h>
|
|
||||||
#import <MTProtoKitDynamic/MTInputStream.h>
|
|
||||||
#import <MTProtoKitDynamic/MTSerialization.h>
|
|
||||||
#import <MTProtoKitDynamic/MTExportedAuthorizationData.h>
|
|
||||||
#import <MTProtoKitDynamic/MTRpcError.h>
|
|
||||||
#import <MTProtoKitDynamic/MTKeychain.h>
|
|
||||||
#import <MTProtoKitDynamic/MTFileBasedKeychain.h>
|
|
||||||
#import <MTProtoKitDynamic/MTContext.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTransportScheme.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterTransferAuthAction.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAuthAction.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAuthMessageService.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAddress.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAddressSet.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAuthInfo.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterSaltInfo.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDatacenterAddressListData.h>
|
|
||||||
#import <MTProtoKitDynamic/MTProto.h>
|
|
||||||
#import <MTProtoKitDynamic/MTSessionInfo.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTimeFixContext.h>
|
|
||||||
#import <MTProtoKitDynamic/MTPreparedMessage.h>
|
|
||||||
#import <MTProtoKitDynamic/MTOutgoingMessage.h>
|
|
||||||
#import <MTProtoKitDynamic/MTIncomingMessage.h>
|
|
||||||
#import <MTProtoKitDynamic/MTMessageEncryptionKey.h>
|
|
||||||
#import <MTProtoKitDynamic/MTMessageService.h>
|
|
||||||
#import <MTProtoKitDynamic/MTMessageTransaction.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTimeSyncMessageService.h>
|
|
||||||
#import <MTProtoKitDynamic/MTRequestMessageService.h>
|
|
||||||
#import <MTProtoKitDynamic/MTRequest.h>
|
|
||||||
#import <MTProtoKitDynamic/MTRequestContext.h>
|
|
||||||
#import <MTProtoKitDynamic/MTRequestErrorContext.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDropResponseContext.h>
|
|
||||||
#import <MTProtoKitDynamic/MTApiEnvironment.h>
|
|
||||||
#import <MTProtoKitDynamic/MTResendMessageService.h>
|
|
||||||
#import <MTProtoKitDynamic/MTNetworkAvailability.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTransport.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTransportTransaction.h>
|
|
||||||
#import <MTProtoKitDynamic/MTTcpTransport.h>
|
|
||||||
#import <MTProtoKitDynamic/MTHttpRequestOperation.h>
|
|
||||||
#import <MTProtoKitDynamic/MTAtomic.h>
|
|
||||||
#import <MTProtoKitDynamic/MTBag.h>
|
|
||||||
#import <MTProtoKitDynamic/MTDisposable.h>
|
|
||||||
#import <MTProtoKitDynamic/MTSubscriber.h>
|
|
||||||
#import <MTProtoKitDynamic/MTSignal.h>
|
|
||||||
#import <MTProtoKitDynamic/MTNetworkUsageCalculationInfo.h>
|
|
||||||
#import <MTProtoKitDynamic/MTNetworkUsageManager.h>
|
|
||||||
#import <MTProtoKitDynamic/MTBackupAddressSignals.h>
|
|
||||||
#import <MTProtoKitDynamic/AFURLConnectionOperation.h>
|
|
||||||
#import <MTProtoKitDynamic/AFHTTPRequestOperation.h>
|
|
||||||
#import <MTProtoKitDynamic/MTProxyConnectivity.h>
|
|
||||||
#import <MTProtoKitDynamic/MTPKCS.h>
|
|
||||||
#import <MTProtoKitDynamic/MTGzip.h>
|
|
||||||
#import <MTProtoKitDynamic/TON.h>
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// MtProtoKitDynamicTests.m
|
|
||||||
// MtProtoKitDynamicTests
|
|
||||||
//
|
|
||||||
// Created by Peter on 08/07/15.
|
|
||||||
// Copyright (c) 2015 Telegram. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
@interface MtProtoKitDynamicTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MtProtoKitDynamicTests
|
|
||||||
|
|
||||||
- (void)setUp {
|
|
||||||
[super setUp];
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)tearDown {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
[super tearDown];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testExample {
|
|
||||||
// This is an example of a functional test case.
|
|
||||||
XCTAssert(YES, @"Pass");
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testPerformanceExample {
|
|
||||||
// This is an example of a performance test case.
|
|
||||||
[self measureBlock:^{
|
|
||||||
// Put the code you want to measure the time of here.
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string>Copyright © 2015 Telegram. All rights reserved.</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string></string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,78 +0,0 @@
|
|||||||
//
|
|
||||||
// MtProtoKitMac.h
|
|
||||||
// MtProtoKitMac
|
|
||||||
//
|
|
||||||
// Created by Peter on 01/05/15.
|
|
||||||
// Copyright (c) 2015 Telegram. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
|
|
||||||
//! Project version number for MtProtoKitMac.
|
|
||||||
FOUNDATION_EXPORT double MtProtoKitMacVersionNumber;
|
|
||||||
|
|
||||||
//! Project version string for MtProtoKitMac.
|
|
||||||
FOUNDATION_EXPORT const unsigned char MtProtoKitMacVersionString[];
|
|
||||||
|
|
||||||
#ifndef MtProtoKitMacFramework
|
|
||||||
# define MtProtoKitMacFramework 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <MtProtoKitMac/MTTime.h>
|
|
||||||
#import <MtProtoKitMac/MTTimer.h>
|
|
||||||
#import <MtProtoKitMac/MTLogging.h>
|
|
||||||
#import <MtProtoKitMac/MTEncryption.h>
|
|
||||||
#import <MtProtoKitMac/MTInternalId.h>
|
|
||||||
#import <MtProtoKitMac/MTQueue.h>
|
|
||||||
#import <MtProtoKitMac/MTOutputStream.h>
|
|
||||||
#import <MtProtoKitMac/MTInputStream.h>
|
|
||||||
#import <MtProtoKitMac/MTSerialization.h>
|
|
||||||
#import <MtProtoKitMac/MTExportedAuthorizationData.h>
|
|
||||||
#import <MtProtoKitMac/MTRpcError.h>
|
|
||||||
#import <MtProtoKitMac/MTKeychain.h>
|
|
||||||
#import <MtProtoKitMac/MTFileBasedKeychain.h>
|
|
||||||
#import <MtProtoKitMac/MTContext.h>
|
|
||||||
#import <MtProtoKitMac/MTTransportScheme.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterTransferAuthAction.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAuthAction.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAuthMessageService.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAddress.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAddressSet.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAuthInfo.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterSaltInfo.h>
|
|
||||||
#import <MtProtoKitMac/MTDatacenterAddressListData.h>
|
|
||||||
#import <MtProtoKitMac/MTProto.h>
|
|
||||||
#import <MtProtoKitMac/MTSessionInfo.h>
|
|
||||||
#import <MtProtoKitMac/MTTimeFixContext.h>
|
|
||||||
#import <MtProtoKitMac/MTPreparedMessage.h>
|
|
||||||
#import <MtProtoKitMac/MTOutgoingMessage.h>
|
|
||||||
#import <MtProtoKitMac/MTIncomingMessage.h>
|
|
||||||
#import <MtProtoKitMac/MTMessageEncryptionKey.h>
|
|
||||||
#import <MtProtoKitMac/MTMessageService.h>
|
|
||||||
#import <MtProtoKitMac/MTMessageTransaction.h>
|
|
||||||
#import <MtProtoKitMac/MTTimeSyncMessageService.h>
|
|
||||||
#import <MtProtoKitMac/MTRequestMessageService.h>
|
|
||||||
#import <MtProtoKitMac/MTRequest.h>
|
|
||||||
#import <MtProtoKitMac/MTRequestContext.h>
|
|
||||||
#import <MtProtoKitMac/MTRequestErrorContext.h>
|
|
||||||
#import <MtProtoKitMac/MTDropResponseContext.h>
|
|
||||||
#import <MtProtoKitMac/MTApiEnvironment.h>
|
|
||||||
#import <MtProtoKitMac/MTResendMessageService.h>
|
|
||||||
#import <MtProtoKitMac/MTNetworkAvailability.h>
|
|
||||||
#import <MtProtoKitMac/MTTransport.h>
|
|
||||||
#import <MtProtoKitMac/MTTransportTransaction.h>
|
|
||||||
#import <MtProtoKitMac/MTTcpTransport.h>
|
|
||||||
#import <MTProtoKitMac/MTHttpRequestOperation.h>
|
|
||||||
#import <MtProtoKitMac/MTAtomic.h>
|
|
||||||
#import <MtProtoKitMac/MTBag.h>
|
|
||||||
#import <MtProtoKitMac/MTDisposable.h>
|
|
||||||
#import <MtProtoKitMac/MTSubscriber.h>
|
|
||||||
#import <MtProtoKitMac/MTSignal.h>
|
|
||||||
#import <MtProtoKitMac/MTNetworkUsageCalculationInfo.h>
|
|
||||||
#import <MtProtoKitMac/MTNetworkUsageManager.h>
|
|
||||||
#import <MtProtoKitMac/MTBackupAddressSignals.h>
|
|
||||||
#import <MtProtoKitMac/AFURLConnectionOperation.h>
|
|
||||||
#import <MtProtoKitMac/AFHTTPRequestOperation.h>
|
|
||||||
#import <MTProtoKitMac/MTProxyConnectivity.h>
|
|
||||||
#import <MTProtoKitMac/MTGzip.h>
|
|
||||||
#import <MTProtoKitMac/TON.h>
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.telegram.$(PRODUCT_NAME:rfc1034identifier)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// MtProtoKitMacTests.m
|
|
||||||
// MtProtoKitMacTests
|
|
||||||
//
|
|
||||||
// Created by Peter on 01/05/15.
|
|
||||||
// Copyright (c) 2015 Telegram. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
@interface MtProtoKitMacTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MtProtoKitMacTests
|
|
||||||
|
|
||||||
- (void)setUp {
|
|
||||||
[super setUp];
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)tearDown {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
[super tearDown];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testExample {
|
|
||||||
// This is an example of a functional test case.
|
|
||||||
XCTAssert(YES, @"Pass");
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testPerformanceExample {
|
|
||||||
// This is an example of a performance test case.
|
|
||||||
[self measureBlock:^{
|
|
||||||
// Put the code you want to measure the time of here.
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string></string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>com.telegram.${PRODUCT_NAME:rfc1034identifier}</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>${PRODUCT_NAME}</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string>Copyright © 2014 Telegram. All rights reserved.</string>
|
|
||||||
<key>NSPrincipalClass</key>
|
|
||||||
<string></string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,10 +0,0 @@
|
|||||||
//
|
|
||||||
// Prefix header
|
|
||||||
//
|
|
||||||
// The contents of this file are implicitly included at the beginning of every source file.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef __OBJC__
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
|||||||
/* Localized versions of Info.plist keys */
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,77 +0,0 @@
|
|||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
#import <MtProtoKit/MTProtoKit.h>
|
|
||||||
#import <MtProtoKit/MTTcpTransport.h>
|
|
||||||
#import <MtProtoKit/MTTransportTransaction.h>
|
|
||||||
|
|
||||||
@interface TestSerialization : NSObject <MTSerialization>
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation TestSerialization
|
|
||||||
|
|
||||||
- (NSUInteger)currentLayer {
|
|
||||||
return 42;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)parseMessage:(NSData *)__unused data {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (MTExportAuthorizationResponseParser)exportAuthorization:(int32_t)datacenterId data:(__autoreleasing NSData **)data {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSData *)importAuthorization:(int32_t)authId bytes:(NSData *)bytes {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (MTRequestDatacenterAddressListParser)requestDatacenterAddressList:(int32_t)datacenterId data:(__autoreleasing NSData **)data {
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface MtProtoKitStabilityTests : XCTestCase <MTTransportDelegate> {
|
|
||||||
MTTcpTransport *_transport;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MtProtoKitStabilityTests
|
|
||||||
|
|
||||||
- (void)setUp {
|
|
||||||
[super setUp];
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)tearDown {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
[super tearDown];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testExample {
|
|
||||||
MTApiEnvironment *apiEnvironment = [[MTApiEnvironment alloc] init];
|
|
||||||
MTContext *context = [[MTContext alloc] initWithSerialization:[[TestSerialization alloc] init] apiEnvironment:apiEnvironment];
|
|
||||||
|
|
||||||
//for (int i = 0; i < 100; i++) {
|
|
||||||
_transport = [[MTTcpTransport alloc] initWithDelegate:self context:context datacenterId:1 address:[[MTDatacenterAddress alloc] initWithIp:@"149.154.175.50" port:443 preferForMedia:false]];
|
|
||||||
_transport.delegate = self;
|
|
||||||
[_transport setDelegateNeedsTransaction];
|
|
||||||
//}
|
|
||||||
sleep(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)transportConnectionStateChanged:(MTTransport *)transport isConnected:(bool)isConnected {
|
|
||||||
if (isConnected) {
|
|
||||||
_transport = nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)transportReadyForTransaction:(MTTransport *)transport transportSpecificTransaction:(MTMessageTransaction *)transportSpecificTransaction forceConfirmations:(bool)forceConfirmations transactionReady:(void (^)(NSArray *))transactionReady {
|
|
||||||
transactionReady(@[[[MTTransportTransaction alloc] initWithPayload:[NSData data] completion:^(bool success, id transactionId) {
|
|
||||||
|
|
||||||
}]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.telegram.$(PRODUCT_NAME:rfc1034identifier)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>en</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>com.telegram.${PRODUCT_NAME:rfc1034identifier}</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>BNDL</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>????</string>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// MtProtoKitTests.m
|
|
||||||
// MtProtoKitTests
|
|
||||||
//
|
|
||||||
// Created by Peter on 13/04/15.
|
|
||||||
// Copyright (c) 2015 Telegram. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
#import <XCTest/XCTest.h>
|
|
||||||
|
|
||||||
@interface MtProtoKitTests : XCTestCase
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MtProtoKitTests
|
|
||||||
|
|
||||||
- (void)setUp {
|
|
||||||
[super setUp];
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)tearDown {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
[super tearDown];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testExample {
|
|
||||||
// This is an example of a functional test case.
|
|
||||||
XCTAssert(YES, @"Pass");
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testPerformanceExample {
|
|
||||||
// This is an example of a performance test case.
|
|
||||||
[self measureBlock:^{
|
|
||||||
// Put the code you want to measure the time of here.
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
@ -1,2 +0,0 @@
|
|||||||
/* Localized versions of Info.plist keys */
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "1030"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "D079AB961AF39B8000076F59"
|
|
||||||
BuildableName = "MtProtoKitMac.framework"
|
|
||||||
BlueprintName = "MtProtoKitMac"
|
|
||||||
ReferencedContainer = "container:MtProtoKit_Xcode.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "D079AB961AF39B8000076F59"
|
|
||||||
BuildableName = "MtProtoKitMac.framework"
|
|
||||||
BlueprintName = "MtProtoKitMac"
|
|
||||||
ReferencedContainer = "container:MtProtoKit_Xcode.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "D079AB961AF39B8000076F59"
|
|
||||||
BuildableName = "MtProtoKitMac.framework"
|
|
||||||
BlueprintName = "MtProtoKitMac"
|
|
||||||
ReferencedContainer = "container:MtProtoKit_Xcode.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user