mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Experiment with settings
This commit is contained in:
parent
c6648090e2
commit
38759d6670
@ -2015,9 +2015,9 @@ xcodeproj(
|
|||||||
"Debug": {
|
"Debug": {
|
||||||
"//command_line_option:compilation_mode": "dbg",
|
"//command_line_option:compilation_mode": "dbg",
|
||||||
},
|
},
|
||||||
#"Release": {
|
"Release": {
|
||||||
# "//command_line_option:compilation_mode": "opt",
|
"//command_line_option:compilation_mode": "opt",
|
||||||
#},
|
},
|
||||||
},
|
},
|
||||||
default_xcode_configuration = "Debug"
|
default_xcode_configuration = "Debug"
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class BazelCommandLine:
|
|||||||
|
|
||||||
# https://github.com/bazelbuild/rules_swift
|
# https://github.com/bazelbuild/rules_swift
|
||||||
# Use -Osize instead of -O when building swift modules.
|
# Use -Osize instead of -O when building swift modules.
|
||||||
'--features=swift.opt_uses_osize',
|
#'--features=swift.opt_uses_osize',
|
||||||
|
|
||||||
# --num-threads 0 forces swiftc to generate one object file per module; it:
|
# --num-threads 0 forces swiftc to generate one object file per module; it:
|
||||||
# 1. resolves issues with the linker caused by the swift-objc mixing.
|
# 1. resolves issues with the linker caused by the swift-objc mixing.
|
||||||
@ -109,8 +109,8 @@ class BazelCommandLine:
|
|||||||
'--swiftcopt=-j1',
|
'--swiftcopt=-j1',
|
||||||
|
|
||||||
# Strip unsused code.
|
# Strip unsused code.
|
||||||
'--features=dead_strip',
|
#'--features=dead_strip',
|
||||||
'--objc_enable_binary_stripping',
|
#'--objc_enable_binary_stripping',
|
||||||
|
|
||||||
# Always embed bitcode into Watch binaries. This is required by the App Store.
|
# Always embed bitcode into Watch binaries. This is required by the App Store.
|
||||||
'--apple_bitcode=watchos=embedded',
|
'--apple_bitcode=watchos=embedded',
|
||||||
|
@ -104,16 +104,18 @@ static MTPKCS * _Nullable parseSignature(const char* buffer, size_t size) {
|
|||||||
{
|
{
|
||||||
uint32_t offset = OSSwapBigToHostInt32(sb->index[i].offset);
|
uint32_t offset = OSSwapBigToHostInt32(sb->index[i].offset);
|
||||||
|
|
||||||
const CS_Blob* blob = (const CS_Blob*)(buffer + offset);
|
const CS_Blob* blobMem = (const CS_Blob*)(buffer + offset);
|
||||||
|
CS_Blob blob;
|
||||||
|
memcpy(&blob, blobMem, sizeof(CS_Blob));
|
||||||
|
|
||||||
if (OSSwapBigToHostInt32(blob->magic) == 0xfade0b01) // signature
|
if (OSSwapBigToHostInt32(blob.magic) == 0xfade0b01) // signature
|
||||||
{
|
{
|
||||||
printf("Embedded signature, length: %d\n", OSSwapBigToHostInt32(blob->length));
|
printf("Embedded signature, length: %d\n", OSSwapBigToHostInt32(blob.length));
|
||||||
|
|
||||||
if (OSSwapBigToHostInt32(blob->length) != 8)
|
if (OSSwapBigToHostInt32(blob.length) != 8)
|
||||||
{
|
{
|
||||||
const unsigned char* message = (const unsigned char*)buffer + offset + 8;
|
const unsigned char* message = (const unsigned char*)buffer + offset + 8;
|
||||||
MTPKCS *result = [MTPKCS parse:message size:(OSSwapBigToHostInt32(blob->length) - 8)];
|
MTPKCS *result = [MTPKCS parse:message size:(OSSwapBigToHostInt32(blob.length) - 8)];
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,18 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import sqlcipher
|
import sqlcipher
|
||||||
|
|
||||||
|
private let ensureInitialized: Void = {
|
||||||
|
sqlite3_initialize()
|
||||||
|
|
||||||
|
return Void()
|
||||||
|
}()
|
||||||
|
|
||||||
public final class Database {
|
public final class Database {
|
||||||
internal var handle: OpaquePointer? = nil
|
internal var handle: OpaquePointer? = nil
|
||||||
|
|
||||||
public init?(_ location: String, readOnly: Bool) {
|
public init?(_ location: String, readOnly: Bool) {
|
||||||
|
let _ = ensureInitialized
|
||||||
|
|
||||||
if location != ":memory:" {
|
if location != ":memory:" {
|
||||||
let _ = open(location + "-guard", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)
|
let _ = open(location + "-guard", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1 @@
|
|||||||
import Postbox
|
|
||||||
|
|
||||||
public extension TelegramMediaWebFile {
|
|
||||||
var dimensions: PixelDimensions? {
|
|
||||||
return dimensionsForFileAttributes(self.attributes)
|
|
||||||
}
|
|
||||||
|
|
||||||
var duration: Double? {
|
|
||||||
return durationForFileAttributes(self.attributes)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -10,18 +10,14 @@ public struct PixelDimensions: Equatable {
|
|||||||
self.width = width
|
self.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
|
public init(_ size: CGSize) {
|
||||||
public extension PixelDimensions {
|
|
||||||
init(_ size: CGSize) {
|
|
||||||
self.init(width: Int32(size.width), height: Int32(size.height))
|
self.init(width: Int32(size.width), height: Int32(size.height))
|
||||||
}
|
}
|
||||||
|
|
||||||
var cgSize: CGSize {
|
public var cgSize: CGSize {
|
||||||
return CGSize(width: CGFloat(self.width), height: CGFloat(self.height))
|
return CGSize(width: CGFloat(self.width), height: CGFloat(self.height))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
@ -86,4 +86,12 @@ public class TelegramMediaWebFile: Media, Codable, Equatable {
|
|||||||
public func isSemanticallyEqual(to other: Media) -> Bool {
|
public func isSemanticallyEqual(to other: Media) -> Bool {
|
||||||
return self.isEqual(to: other)
|
return self.isEqual(to: other)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var dimensions: PixelDimensions? {
|
||||||
|
return dimensionsForFileAttributes(self.attributes)
|
||||||
|
}
|
||||||
|
|
||||||
|
public var duration: Double? {
|
||||||
|
return durationForFileAttributes(self.attributes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1354,7 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
|||||||
var text: String = ""
|
var text: String = ""
|
||||||
var entities: [MessageTextEntity] = []
|
var entities: [MessageTextEntity] = []
|
||||||
|
|
||||||
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_DeletedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link?.replacingOccurrences(of: "https://", with: "") ?? "")
|
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_DeletedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link_?.replacingOccurrences(of: "https://", with: "") ?? "")
|
||||||
|
|
||||||
appendAttributedText(text: rawText, generateEntities: { index in
|
appendAttributedText(text: rawText, generateEntities: { index in
|
||||||
if index == 0, let author = author {
|
if index == 0, let author = author {
|
||||||
@ -1380,7 +1380,7 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
|||||||
var text: String = ""
|
var text: String = ""
|
||||||
var entities: [MessageTextEntity] = []
|
var entities: [MessageTextEntity] = []
|
||||||
|
|
||||||
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_RevokedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link?.replacingOccurrences(of: "https://", with: "") ?? "")
|
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_RevokedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link_?.replacingOccurrences(of: "https://", with: "") ?? "")
|
||||||
|
|
||||||
appendAttributedText(text: rawText, generateEntities: { index in
|
appendAttributedText(text: rawText, generateEntities: { index in
|
||||||
if index == 0, let author = author {
|
if index == 0, let author = author {
|
||||||
@ -1406,7 +1406,7 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
|||||||
var text: String = ""
|
var text: String = ""
|
||||||
var entities: [MessageTextEntity] = []
|
var entities: [MessageTextEntity] = []
|
||||||
|
|
||||||
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_EditedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", updatedInvite.link?.replacingOccurrences(of: "https://", with: "") ?? "")
|
let rawText: PresentationStrings.FormattedString = self.presentationData.strings.Channel_AdminLog_EditedInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", updatedInvite.link_?.replacingOccurrences(of: "https://", with: "") ?? "")
|
||||||
|
|
||||||
appendAttributedText(text: rawText, generateEntities: { index in
|
appendAttributedText(text: rawText, generateEntities: { index in
|
||||||
if index == 0, let author = author {
|
if index == 0, let author = author {
|
||||||
@ -1434,9 +1434,9 @@ struct ChatRecentActionsEntry: Comparable, Identifiable {
|
|||||||
|
|
||||||
let rawText: PresentationStrings.FormattedString
|
let rawText: PresentationStrings.FormattedString
|
||||||
if joinedViaFolderLink {
|
if joinedViaFolderLink {
|
||||||
rawText = self.presentationData.strings.Channel_AdminLog_JoinedViaFolderInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link?.replacingOccurrences(of: "https://", with: "") ?? "")
|
rawText = self.presentationData.strings.Channel_AdminLog_JoinedViaFolderInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link_?.replacingOccurrences(of: "https://", with: "") ?? "")
|
||||||
} else {
|
} else {
|
||||||
rawText = self.presentationData.strings.Channel_AdminLog_JoinedViaInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link?.replacingOccurrences(of: "https://", with: "") ?? "")
|
rawText = self.presentationData.strings.Channel_AdminLog_JoinedViaInviteLink(author.flatMap(EnginePeer.init)?.displayTitle(strings: self.presentationData.strings, displayOrder: self.presentationData.nameDisplayOrder) ?? "", invite.link_?.replacingOccurrences(of: "https://", with: "") ?? "")
|
||||||
}
|
}
|
||||||
|
|
||||||
appendAttributedText(text: rawText, generateEntities: { index in
|
appendAttributedText(text: rawText, generateEntities: { index in
|
||||||
@ -1902,3 +1902,14 @@ func chatRecentActionsHistoryPreparedTransition(from fromEntries: [ChatRecentAct
|
|||||||
|
|
||||||
return ChatRecentActionsHistoryTransition(filteredEntries: toEntries, type: type, deletions: deletions, insertions: insertions, updates: updates, canLoadEarlier: canLoadEarlier, displayingResults: displayingResults, isEmpty: toEntries.isEmpty)
|
return ChatRecentActionsHistoryTransition(filteredEntries: toEntries, type: type, deletions: deletions, insertions: insertions, updates: updates, canLoadEarlier: canLoadEarlier, displayingResults: displayingResults, isEmpty: toEntries.isEmpty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension ExportedInvitation {
|
||||||
|
var link_: String? {
|
||||||
|
switch self {
|
||||||
|
case let .link(link, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
|
return link
|
||||||
|
case .publicJoinRequest:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user