mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various improvements
This commit is contained in:
parent
e16f2ff47f
commit
18a491fa48
@ -911,7 +911,7 @@ ASLayoutElementStyleExtensibilityForwarding
|
||||
NSArray<ASLayout *> *sublayouts = _calculatedDisplayNodeLayout.layout.sublayouts;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
@ -938,7 +938,7 @@ ASLayoutElementStyleExtensibilityForwarding
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@ NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -142,7 +142,7 @@ Class _Nullable ASGetClassFromType(const char * _Nullable type)
|
||||
size_t resultLength = typeLength - 3;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -237,7 +237,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT(
|
||||
// Fast-reverse-enumerate the sublayouts array by copying it into a C-array and push_front'ing each into the queue.
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -161,7 +161,7 @@ ASLayoutElementStyleExtensibilityForwarding
|
||||
// Use tiny descriptions because these trees can get nested very deep.
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
@ -301,7 +301,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__)
|
||||
const auto count = children.count;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 180400
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1177,9 +1177,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
ApplicationSpecificNotice.displayChatListArchiveTooltip(accountManager: self.context.sharedContext.accountManager),
|
||||
self.context.engine.data.get(
|
||||
TelegramEngine.EngineData.Item.Configuration.GlobalPrivacy()
|
||||
)
|
||||
),
|
||||
self.context.engine.messages.chatList(group: .archive, count: 20) |> take(1)
|
||||
)
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak self] didDisplayTip, settings in
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak self] didDisplayTip, settings, chatListHead in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
@ -1192,7 +1193,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
navigationController.pushViewController(chatListController)
|
||||
}
|
||||
|
||||
if !didDisplayTip {
|
||||
if !didDisplayTip, chatListHead.items.count < 10 {
|
||||
#if DEBUG
|
||||
#else
|
||||
let _ = ApplicationSpecificNotice.setDisplayChatListArchiveTooltip(accountManager: self.context.sharedContext.accountManager).startStandalone()
|
||||
|
@ -201,8 +201,8 @@ private enum ContactListNodeEntry: Comparable, Identifiable {
|
||||
status = .none
|
||||
itemPeer = .deviceContact(stableId: id, contact: contact)
|
||||
}
|
||||
if isSearch {
|
||||
status = .none
|
||||
if isSearch, case let .peer(peer, _) = itemPeer, let _ = peer?.addressName {
|
||||
status = .addressName("")
|
||||
}
|
||||
var itemContextAction: ((ASDisplayNode, ContextGesture?, CGPoint?) -> Void)?
|
||||
if isContextActionEnabled, let contextAction = interaction.contextAction {
|
||||
|
@ -246,7 +246,7 @@ ActionStage *ActionStageInstance()
|
||||
int length = (int)path.length;
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
unichar newPath[path.length];
|
||||
|
@ -258,7 +258,7 @@ static bool consumeField(const char *desc, int length, int &offset, uint32_t &ou
|
||||
outName = (uint32_t)murMurHashBytes32((void *)(desc + offset), i - offset);
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
char buf[i - offset + 1];
|
||||
|
@ -27,7 +27,7 @@ static void decay_position(CGFloat *x, CGFloat *v, NSUInteger count, CFTimeInter
|
||||
// x0 = x;
|
||||
// x = x0 + v0 * deceleration * (1 - powf(deceleration, dt)) / (1 - deceleration)
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
float v0[count];
|
||||
|
@ -1140,7 +1140,7 @@ int32_t phoneMatchHash(NSString *phone)
|
||||
{
|
||||
int length = (int)phone.length;
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
char cleanString[length];
|
||||
|
@ -11,7 +11,7 @@
|
||||
int windowBits = 15 + 32; //Default + gzip header instead of zlib header
|
||||
int retCode;
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wgnu-folding-constant"
|
||||
|
@ -689,7 +689,7 @@
|
||||
int windowBits = 15 + 32; //Default + gzip header instead of zlib header
|
||||
int retCode;
|
||||
#pragma clang diagnostic push
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 260000
|
||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180500
|
||||
#pragma clang diagnostic ignored "-Wvla-cxx-extension"
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wgnu-folding-constant"
|
||||
|
@ -1061,6 +1061,7 @@ public final class ChatListView {
|
||||
extractedCachedData: entryData.extractedCachedData
|
||||
)))
|
||||
case let .HoleEntry(hole):
|
||||
entries.removeAll()
|
||||
entries.append(.HoleEntry(hole))
|
||||
case .IntermediateMessageEntry:
|
||||
assertionFailure()
|
||||
|
@ -2670,7 +2670,7 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
|
||||
}*/
|
||||
|
||||
var hasReply = replyMessage != nil || replyForward != nil || replyStory != nil
|
||||
if !isInstantVideo, hasThreadInfo {
|
||||
if !isInstantVideo && hasThreadInfo {
|
||||
if let threadId = item.message.threadId, let replyMessage = replyMessage, Int64(replyMessage.id.id) == threadId {
|
||||
hasReply = false
|
||||
}
|
||||
@ -2701,6 +2701,9 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI
|
||||
headerSize.height += threadInfoSizeApply.0.height + 5.0
|
||||
}*/
|
||||
}
|
||||
if !isInstantVideo, hasReply, let threadId = item.message.threadId, let replyMessage, replyQuote == nil, case let .replyThread(replyThread) = item.chatLocation, replyThread.isChannelPost, replyMessage.id.id == Int32(clamping: threadId) {
|
||||
hasReply = false
|
||||
}
|
||||
|
||||
if !isInstantVideo, hasReply, (replyMessage != nil || replyForward != nil || replyStory != nil) {
|
||||
if headerSize.height.isZero {
|
||||
|
@ -2090,7 +2090,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
let subtitleBadgeFrame: CGRect
|
||||
subtitleBadgeFrame = CGRect(origin: CGPoint(x: (-subtitleSize.width) * 0.5 - subtitleRatingSize.width + 1.0, y: subtitleOffset + floor((-subtitleRatingSize.height) * 0.5)), size: subtitleRatingSize)
|
||||
transition.updateFrameAdditive(view: subtitleRatingView, frame: subtitleBadgeFrame)
|
||||
transition.updateAlpha(layer: subtitleRatingView.layer, alpha: subtitleAlpha)
|
||||
transition.updateAlpha(layer: subtitleRatingView.layer, alpha: subtitleAlpha * (1.0 - transitionFraction))
|
||||
}
|
||||
} else {
|
||||
let titleScale: CGFloat
|
||||
|
@ -385,7 +385,7 @@ final class PeerInfoStoryGridScreenComponent: Component {
|
||||
}
|
||||
|
||||
if let selectionModeCompletion = component.selectionModeCompletion {
|
||||
selectionModeCompletion(Array(paneNode.selectedItems.values))
|
||||
selectionModeCompletion(Array(paneNode.selectedItems.sorted(by: { $0.key < $1.key }).map(\.value)))
|
||||
environment.controller()?.dismiss()
|
||||
return
|
||||
}
|
||||
|
@ -1028,7 +1028,18 @@ private final class SendInviteLinkScreenComponent: Component {
|
||||
let presentationData = component.context.sharedContext.currentPresentationData.with { $0 }
|
||||
controller.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: false, text: text), elevatedLayout: false, action: { _ in return false }), in: .window(.root))
|
||||
|
||||
controller.dismiss()
|
||||
let navigationController = controller.navigationController as? NavigationController
|
||||
|
||||
let context = component.context
|
||||
controller.dismiss(completion: { [weak navigationController] in
|
||||
if let navigationController, let peer = selectedPeers.first?.peer {
|
||||
context.sharedContext.navigateToChatController(NavigateToChatControllerParams(
|
||||
navigationController: navigationController,
|
||||
context: context,
|
||||
chatLocation: .peer(peer)
|
||||
))
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -51,6 +51,9 @@ final class NotificationContainerControllerNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
if self.alpha == 0.0 {
|
||||
return nil
|
||||
}
|
||||
if let (_, blockingItemNode) = self.blockingItemAndNode {
|
||||
return blockingItemNode.hitTest(point, with: event)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user