mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-25 20:50:47 +00:00
Cleanup
This commit is contained in:
parent
8b2bcc462c
commit
7512f7f017
@ -1782,10 +1782,15 @@ ios_application(
|
|||||||
#"//submodules/Display",
|
#"//submodules/Display",
|
||||||
#"//submodules/TelegramCore",
|
#"//submodules/TelegramCore",
|
||||||
#"//submodules/FFMpegBinding",
|
#"//submodules/FFMpegBinding",
|
||||||
"//third-party/webrtc",
|
#"//third-party/webrtc",
|
||||||
"//third-party/webrtc:webrtc_objc",
|
#"//third-party/webrtc:webrtc_objc",
|
||||||
#"//submodules/AsyncDisplayKit",
|
#"//submodules/AsyncDisplayKit",
|
||||||
#"//submodules/ObjCRuntimeUtils",
|
#"//submodules/ObjCRuntimeUtils",
|
||||||
|
#"//submodules/OpusBinding",
|
||||||
|
#"//third-party/boringssl:ssl",
|
||||||
|
#"//third-party/boringssl:crypto",
|
||||||
|
#"//submodules/TelegramVoip",
|
||||||
|
"//submodules/TelegramUI",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -278,6 +278,9 @@ def _collect_spm_modules_impl(target, ctx):
|
|||||||
if SPMModulesInfo in dep:
|
if SPMModulesInfo in dep:
|
||||||
# Merge the modules dictionaries
|
# Merge the modules dictionaries
|
||||||
for label, info in dep[SPMModulesInfo].modules.items():
|
for label, info in dep[SPMModulesInfo].modules.items():
|
||||||
|
if label in all_modules:
|
||||||
|
if all_modules[label]["path"] != info["path"]:
|
||||||
|
fail("Duplicate module name: {}".format(label))
|
||||||
all_modules[label] = info
|
all_modules[label] = info
|
||||||
# Add transitive sources depset from dependency to the list
|
# Add transitive sources depset from dependency to the list
|
||||||
dep_transitive_sources_list.append(dep[SPMModulesInfo].transitive_sources)
|
dep_transitive_sources_list.append(dep[SPMModulesInfo].transitive_sources)
|
||||||
|
@ -105,20 +105,21 @@ for name, module in sorted(modules.items()):
|
|||||||
combined_lines.append(" .target(")
|
combined_lines.append(" .target(")
|
||||||
combined_lines.append(" name: \"%s\"," % name)
|
combined_lines.append(" name: \"%s\"," % name)
|
||||||
|
|
||||||
relative_module_path = module["path"] + "/Module_" + name
|
relative_module_path = module["path"]
|
||||||
module_directory = spm_files_dir + "/" + relative_module_path
|
module_directory = spm_files_dir + "/" + relative_module_path
|
||||||
os.makedirs(module_directory, exist_ok=True)
|
os.makedirs(module_directory, exist_ok=True)
|
||||||
|
|
||||||
module_public_headers_prefix = ""
|
module_public_headers_prefix = ""
|
||||||
if len(module["includes"]) > 1:
|
if module_type == "objc_library" or module_type == "cc_library":
|
||||||
print("{}: Multiple includes are not yet supported: {}".format(name, module["includes"]))
|
if len(module["includes"]) > 1:
|
||||||
sys.exit(1)
|
print("{}: Multiple includes are not yet supported: {}".format(name, module["includes"]))
|
||||||
elif len(module["includes"]) == 1:
|
sys.exit(1)
|
||||||
for include_directory in module["includes"]:
|
elif len(module["includes"]) == 1:
|
||||||
if include_directory != ".":
|
for include_directory in module["includes"]:
|
||||||
#print("{}: Include directory: {}".format(name, include_directory))
|
if include_directory != ".":
|
||||||
module_public_headers_prefix = include_directory
|
#print("{}: Include directory: {}".format(name, include_directory))
|
||||||
break
|
module_public_headers_prefix = include_directory
|
||||||
|
break
|
||||||
|
|
||||||
combined_lines.append(" dependencies: [")
|
combined_lines.append(" dependencies: [")
|
||||||
for dep in module["deps"]:
|
for dep in module["deps"]:
|
||||||
@ -181,13 +182,18 @@ for name, module in sorted(modules.items()):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
module_to_source_files[name] = include_source_files
|
module_to_source_files[name] = include_source_files
|
||||||
|
|
||||||
if True:
|
ignore_sub_folders = []
|
||||||
combined_lines.append(f" sources: sourceFileMap[\"{name}\"]!,")
|
for other_name, other_module in sorted(modules.items()):
|
||||||
else:
|
if other_module["path"] != module["path"] and other_module["path"].startswith(module["path"] + "/"):
|
||||||
combined_lines.append(" sources: [")
|
exclude_path = other_module["path"][len(module["path"]) + 1:]
|
||||||
for include_source_file in include_source_files:
|
ignore_sub_folders.append(exclude_path)
|
||||||
combined_lines.append(" \"%s\"," % (include_source_file))
|
if len(ignore_sub_folders) != 0:
|
||||||
|
combined_lines.append(" exclude: [")
|
||||||
|
for sub_folder in ignore_sub_folders:
|
||||||
|
combined_lines.append(f" \"{sub_folder}\",")
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
|
combined_lines.append(f" sources: sourceFileMap[\"{name}\"]!,")
|
||||||
|
|
||||||
modulemap_path = os.path.join(os.path.join(os.path.join(module_directory), module_public_headers_prefix), "module.modulemap")
|
modulemap_path = os.path.join(os.path.join(os.path.join(module_directory), module_public_headers_prefix), "module.modulemap")
|
||||||
if modulemap_path not in modulemaps:
|
if modulemap_path not in modulemaps:
|
||||||
@ -223,27 +229,18 @@ for name, module in sorted(modules.items()):
|
|||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
for flag in copts:
|
for flag in copts:
|
||||||
escaped_flag = escape_swift_string_literal_component(flag)
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
if escaped_flag.startswith("-I"):
|
if escaped_flag.startswith("-I") and False:
|
||||||
include_path = escaped_flag[2:]
|
include_path = escaped_flag[2:]
|
||||||
#print("{}: Include path: {}".format(name, include_path))
|
#print("{}: Include path: {}".format(name, include_path))
|
||||||
found_reference = False
|
found_reference = False
|
||||||
for another_module_name, another_module in sorted(modules.items()):
|
for another_module_name, another_module in sorted(modules.items()):
|
||||||
another_module_path = another_module["path"]
|
another_module_path = another_module["path"]
|
||||||
if include_path.startswith(another_module_path):
|
if include_path.startswith(another_module_path):
|
||||||
relative_module_include_path = include_path[len(another_module_path) + 1:]
|
combined_lines.append(f' "-I{include_path}",')
|
||||||
|
|
||||||
#print(" {}: Matches module: {}".format(another_module_name, another_module_path))
|
|
||||||
|
|
||||||
matched_public_include = False
|
|
||||||
if len(relative_module_include_path) == 0:
|
|
||||||
combined_lines.append(f' "-I{another_module_path}/Module_{another_module_name}",')
|
|
||||||
else:
|
|
||||||
combined_lines.append(f' "-I{another_module_path}/Module_{another_module_name}/{relative_module_include_path}",')
|
|
||||||
found_reference = True
|
found_reference = True
|
||||||
if not found_reference:
|
if not found_reference:
|
||||||
print(f"{name}: Unresolved include path: {include_path}")
|
print(f"{name}: Unresolved include path: {include_path}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
combined_lines.append(f' "{escaped_flag}",')
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
combined_lines.append(" ]),")
|
combined_lines.append(" ]),")
|
||||||
|
@ -3,9 +3,12 @@
|
|||||||
#import <CommonCrypto/CommonCrypto.h>
|
#import <CommonCrypto/CommonCrypto.h>
|
||||||
|
|
||||||
NSData * _Nonnull CryptoMD5(const void * _Nonnull bytes, int count) {
|
NSData * _Nonnull CryptoMD5(const void * _Nonnull bytes, int count) {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
NSMutableData *result = [[NSMutableData alloc] initWithLength:(NSUInteger)CC_MD5_DIGEST_LENGTH];
|
NSMutableData *result = [[NSMutableData alloc] initWithLength:(NSUInteger)CC_MD5_DIGEST_LENGTH];
|
||||||
CC_MD5(bytes, (CC_LONG)count, result.mutableBytes);
|
CC_MD5(bytes, (CC_LONG)count, result.mutableBytes);
|
||||||
return result;
|
return result;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData * _Nonnull CryptoSHA1(const void * _Nonnull bytes, int count) {
|
NSData * _Nonnull CryptoSHA1(const void * _Nonnull bytes, int count) {
|
||||||
@ -32,6 +35,9 @@ NSData * _Nonnull CryptoSHA512(const void * _Nonnull bytes, int count) {
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
@implementation IncrementalMD5
|
@implementation IncrementalMD5
|
||||||
|
|
||||||
- (instancetype _Nonnull)init {
|
- (instancetype _Nonnull)init {
|
||||||
@ -56,6 +62,8 @@ NSData * _Nonnull CryptoSHA512(const void * _Nonnull bytes, int count) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NSData * _Nullable CryptoAES(bool encrypt, NSData * _Nonnull key, NSData * _Nonnull iv, NSData * _Nonnull data) {
|
NSData * _Nullable CryptoAES(bool encrypt, NSData * _Nonnull key, NSData * _Nonnull iv, NSData * _Nonnull data) {
|
||||||
|
@ -3,7 +3,7 @@ import Postbox
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
import EncryptionProvider
|
||||||
|
|
||||||
struct SecretChatRequestData {
|
struct SecretChatRequestData {
|
||||||
let g: Int32
|
let g: Int32
|
||||||
|
@ -3,6 +3,7 @@ import Postbox
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
import EncryptionProvider
|
||||||
|
|
||||||
private func reactionGeneratedEvent(_ previousReactions: ReactionsMessageAttribute?, _ updatedReactions: ReactionsMessageAttribute?, message: Message, transaction: Transaction) -> (reactionAuthor: Peer, reaction: MessageReaction.Reaction, message: Message, timestamp: Int32)? {
|
private func reactionGeneratedEvent(_ previousReactions: ReactionsMessageAttribute?, _ updatedReactions: ReactionsMessageAttribute?, message: Message, transaction: Transaction) -> (reactionAuthor: Peer, reaction: MessageReaction.Reaction, message: Message, timestamp: Int32)? {
|
||||||
if let updatedReactions = updatedReactions, !message.flags.contains(.Incoming), message.id.peerId.namespace == Namespaces.Peer.CloudUser {
|
if let updatedReactions = updatedReactions, !message.flags.contains(.Incoming), message.id.peerId.namespace == Namespaces.Peer.CloudUser {
|
||||||
|
@ -2,6 +2,7 @@ import Postbox
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
import Foundation
|
||||||
|
|
||||||
public final class TelegramKeyPair: Equatable {
|
public final class TelegramKeyPair: Equatable {
|
||||||
public let id: Int64
|
public let id: Int64
|
||||||
|
@ -2,6 +2,7 @@ import SwiftSignalKit
|
|||||||
import Postbox
|
import Postbox
|
||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
import Foundation
|
||||||
|
|
||||||
public struct EngineCallStreamState {
|
public struct EngineCallStreamState {
|
||||||
public struct Channel {
|
public struct Channel {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import Postbox
|
import Postbox
|
||||||
import TelegramApi
|
import TelegramApi
|
||||||
import MtProtoKit
|
import MtProtoKit
|
||||||
|
import Foundation
|
||||||
|
|
||||||
public func smallestVideoRepresentation(_ representations: [TelegramMediaImage.VideoRepresentation]) -> TelegramMediaImage.VideoRepresentation? {
|
public func smallestVideoRepresentation(_ representations: [TelegramMediaImage.VideoRepresentation]) -> TelegramMediaImage.VideoRepresentation? {
|
||||||
if representations.count == 0 {
|
if representations.count == 0 {
|
||||||
|
@ -2,6 +2,7 @@ import Foundation
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import TgVoipWebrtc
|
import TgVoipWebrtc
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
import CoreMedia
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
public class OngoingCallContext {
|
public class OngoingCallContext {
|
||||||
|
@ -3,6 +3,7 @@ import SwiftSignalKit
|
|||||||
import TelegramCore
|
import TelegramCore
|
||||||
import Network
|
import Network
|
||||||
import TelegramUIPreferences
|
import TelegramUIPreferences
|
||||||
|
import CoreMedia
|
||||||
|
|
||||||
import TgVoipWebrtc
|
import TgVoipWebrtc
|
||||||
|
|
||||||
|
@ -125,8 +125,6 @@ sources = glob([
|
|||||||
"tgcalls/tgcalls/v2/SignalingConnection.cpp",
|
"tgcalls/tgcalls/v2/SignalingConnection.cpp",
|
||||||
"tgcalls/tgcalls/v2/SignalingEncryption.cpp",
|
"tgcalls/tgcalls/v2/SignalingEncryption.cpp",
|
||||||
"tgcalls/tgcalls/v2/SignalingSctpConnection.cpp",
|
"tgcalls/tgcalls/v2/SignalingSctpConnection.cpp",
|
||||||
"tgcalls/tgcalls/v2/SignalingKcpConnection.cpp",
|
|
||||||
"tgcalls/tgcalls/v2/ikcp.cpp",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
objc_library(
|
objc_library(
|
||||||
@ -155,6 +153,7 @@ objc_library(
|
|||||||
"-DRTC_ENABLE_VP9",
|
"-DRTC_ENABLE_VP9",
|
||||||
"-DTGVOIP_NAMESPACE=tgvoip_webrtc",
|
"-DTGVOIP_NAMESPACE=tgvoip_webrtc",
|
||||||
"-std=c++17",
|
"-std=c++17",
|
||||||
|
"-Werror",
|
||||||
] + optimization_flags,
|
] + optimization_flags,
|
||||||
includes = [
|
includes = [
|
||||||
"PublicHeaders",
|
"PublicHeaders",
|
||||||
|
4
third-party/ogg/include/ogg/os_types.h
vendored
4
third-party/ogg/include/ogg/os_types.h
vendored
@ -71,6 +71,10 @@
|
|||||||
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
|
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
|
||||||
|
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
# include <_types/_uint16_t.h>
|
||||||
|
# include <_types/_uint32_t.h>
|
||||||
|
# include <_types/_uint64_t.h>
|
||||||
|
|
||||||
typedef int16_t ogg_int16_t;
|
typedef int16_t ogg_int16_t;
|
||||||
typedef uint16_t ogg_uint16_t;
|
typedef uint16_t ogg_uint16_t;
|
||||||
typedef int32_t ogg_int32_t;
|
typedef int32_t ogg_int32_t;
|
||||||
|
10
third-party/rnnoise/Sources/rnn.c
vendored
10
third-party/rnnoise/Sources/rnn.c
vendored
@ -102,7 +102,10 @@ void compute_dense(const DenseLayer *layer, float *output, const float *input)
|
|||||||
for (i=0;i<N;i++)
|
for (i=0;i<N;i++)
|
||||||
output[i] = relu(output[i]);
|
output[i] = relu(output[i]);
|
||||||
} else {
|
} else {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wnull-dereference"
|
||||||
*(int*)0=0;
|
*(int*)0=0;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,7 +151,12 @@ void compute_gru(const GRULayer *gru, float *state, const float *input)
|
|||||||
if (gru->activation == ACTIVATION_SIGMOID) sum = sigmoid_approx(WEIGHTS_SCALE*sum);
|
if (gru->activation == ACTIVATION_SIGMOID) sum = sigmoid_approx(WEIGHTS_SCALE*sum);
|
||||||
else if (gru->activation == ACTIVATION_TANH) sum = tansig_approx(WEIGHTS_SCALE*sum);
|
else if (gru->activation == ACTIVATION_TANH) sum = tansig_approx(WEIGHTS_SCALE*sum);
|
||||||
else if (gru->activation == ACTIVATION_RELU) sum = relu(WEIGHTS_SCALE*sum);
|
else if (gru->activation == ACTIVATION_RELU) sum = relu(WEIGHTS_SCALE*sum);
|
||||||
else *(int*)0=0;
|
else {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wnull-dereference"
|
||||||
|
*(int*)0=0;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
}
|
||||||
h[i] = z[i]*state[i] + (1-z[i])*sum;
|
h[i] = z[i]*state[i] + (1-z[i])*sum;
|
||||||
}
|
}
|
||||||
for (i=0;i<N;i++)
|
for (i=0;i<N;i++)
|
||||||
|
3
third-party/webrtc/BUILD
vendored
3
third-party/webrtc/BUILD
vendored
@ -3127,6 +3127,7 @@ objc_library(
|
|||||||
"-Wno-all",
|
"-Wno-all",
|
||||||
"-Ithird-party/webrtc/libsrtp/third_party/libsrtp/include",
|
"-Ithird-party/webrtc/libsrtp/third_party/libsrtp/include",
|
||||||
"-Ithird-party/webrtc/libsrtp/third_party/libsrtp/crypto/include",
|
"-Ithird-party/webrtc/libsrtp/third_party/libsrtp/crypto/include",
|
||||||
|
"-Ithird-party/webrtc/libsrtp",
|
||||||
"-Ithird-party/webrtc/webrtc/",
|
"-Ithird-party/webrtc/webrtc/",
|
||||||
"-Ithird-party/libyuv",
|
"-Ithird-party/libyuv",
|
||||||
"-Ithird-party/webrtc/absl",
|
"-Ithird-party/webrtc/absl",
|
||||||
@ -3163,7 +3164,7 @@ objc_library(
|
|||||||
":field_trials_header",
|
":field_trials_header",
|
||||||
"//third-party/webrtc/crc32c",
|
"//third-party/webrtc/crc32c",
|
||||||
"//third-party/webrtc/libsrtp_config",
|
"//third-party/webrtc/libsrtp_config",
|
||||||
"//third-party/webrtc/rnnoise",
|
"//third-party/webrtc/rnnoise:webrtc_rnnoise",
|
||||||
"//third-party/webrtc/pffft",
|
"//third-party/webrtc/pffft",
|
||||||
"//third-party/webrtc/libsrtp",
|
"//third-party/webrtc/libsrtp",
|
||||||
"//third-party/webrtc/absl",
|
"//third-party/webrtc/absl",
|
||||||
|
2
third-party/webrtc/rnnoise/BUILD
vendored
2
third-party/webrtc/rnnoise/BUILD
vendored
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "rnnoise",
|
name = "webrtc_rnnoise",
|
||||||
hdrs = [
|
hdrs = [
|
||||||
"third_party/rnnoise/src/rnn_vad_weights.h",
|
"third_party/rnnoise/src/rnn_vad_weights.h",
|
||||||
"third_party/rnnoise/src/rnn_activations.h",
|
"third_party/rnnoise/src/rnn_activations.h",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user