Bug fixes

This commit is contained in:
Isaac 2026-02-06 17:14:35 +04:00
parent a3b4b085ae
commit 002df956d2
15 changed files with 115 additions and 13 deletions

View file

@ -55,6 +55,8 @@ public final class VoiceBlobView: UIView, TGModernConversationInputMicButtonDeco
private(set) var isAnimating = false
public var hitTestSize: CGFloat?
public typealias BlobRange = (min: CGFloat, max: CGFloat)
public init(
@ -224,6 +226,15 @@ public final class VoiceBlobView: UIView, TGModernConversationInputMicButtonDeco
self.updateBlobsState()
}
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if let hitTestSize = self.hitTestSize {
if !CGSize(width: hitTestSize, height: hitTestSize).centered(in: self.bounds).contains(point) {
return nil
}
}
return super.hitTest(point, with: event)
}
}
final class BlobNode: ASDisplayNode {

View file

@ -83,12 +83,14 @@ final class PeerChatTopTaggedMessageIdsTable: Table {
let currentTopMessageId = self.get(peerId: message.id.peerId, threadId: message.threadId, namespace: message.id.namespace)
if currentTopMessageId == nil || currentTopMessageId! < message.id {
self.set(peerId: message.id.peerId, threadId: message.threadId, namespace: message.id.namespace, id: message.id)
self.set(peerId: message.id.peerId, threadId: 0, namespace: message.id.namespace, id: message.id)
}
}
case let .Remove(indices):
for (index, _, threadId) in indices {
if let messageId = self.get(peerId: index.id.peerId, threadId: threadId, namespace: index.id.namespace), index.id == messageId {
self.set(peerId: index.id.peerId, threadId: threadId, namespace: index.id.namespace, id: nil)
self.set(peerId: index.id.peerId, threadId: 0, namespace: index.id.namespace, id: nil)
}
}
default:
@ -110,8 +112,12 @@ final class PeerChatTopTaggedMessageIdsTable: Table {
if let maybeMessageId = maybeMessageId {
var messageIdId: Int32 = maybeMessageId.id
self.valueBox.set(self.table, key: self.key(combinedId: record.peerAndThreadId, namespace: record.namespace), value: MemoryBuffer(memory: &messageIdId, capacity: 4, length: 4, freeWhenDone: false))
if record.peerAndThreadId.threadId != nil {
self.valueBox.set(self.table, key: self.key(combinedId: PeerAndThreadId(peerId: record.peerAndThreadId.peerId, threadId: 0), namespace: record.namespace), value: MemoryBuffer(memory: &messageIdId, capacity: 4, length: 4, freeWhenDone: false))
}
} else {
self.valueBox.remove(self.table, key: self.key(combinedId: record.peerAndThreadId, namespace: record.namespace), secure: false)
self.valueBox.remove(self.table, key: self.key(combinedId: PeerAndThreadId(peerId: record.peerAndThreadId.peerId, threadId: 0), namespace: record.namespace), secure: false)
}
}
}

View file

@ -3507,7 +3507,13 @@ final class PostboxImpl {
}
if let peerId = mainPeerIdForTopTaggedMessages {
for namespace in topTaggedMessageIdNamespaces {
if let messageId = self.peerChatTopTaggedMessageIdsTable.get(peerId: peerId.peerId, threadId: peerId.threadId, namespace: namespace) {
var messageId: MessageId?
messageId = self.peerChatTopTaggedMessageIdsTable.get(peerId: peerId.peerId, threadId: peerId.threadId, namespace: namespace)
if messageId == nil && peerId.threadId == nil {
messageId = self.peerChatTopTaggedMessageIdsTable.get(peerId: peerId.peerId, threadId: 0, namespace: namespace)
}
if let messageId {
if let index = self.messageHistoryIndexTable.getIndex(messageId) {
if let message = self.messageHistoryTable.getMessage(index) {
topTaggedMessages[namespace] = MessageHistoryTopTaggedMessage.intermediate(message)

View file

@ -12,7 +12,7 @@ public func stringForFullAuthorName(message: EngineMessage, strings: Presentatio
} else if author.isDeleted {
authorName = strings.User_DeletedAccount
} else {
authorName = author.compactDisplayTitle
authorName = author.displayTitle(strings: strings, displayOrder: nameDisplayOrder)
}
if let peer = message.peers[message.id.peerId].flatMap(EnginePeer.init), author.id != peer.id {
authorString = [authorName, peer.displayTitle(strings: strings, displayOrder: nameDisplayOrder)]

View file

@ -322,6 +322,7 @@ public final class ChatTextInputMediaRecordingButton: TGModernConversationInputM
)
let theme = self.hidesOnLock ? defaultDarkColorPresentationTheme : self.theme
blobView.setColor(theme.chat.inputPanel.actionControlFillColor)
blobView.hitTestSize = 110.0
self.micDecorationValue = blobView
return blobView
}

View file

@ -827,6 +827,17 @@ public final class ContextControllerActionsListStackItem: ContextControllerActio
self.addSubnode(item.node)
}
if let tipSignal = tipSignal {
self.tipDisposable = (tipSignal
|> deliverOnMainQueue).start(next: { [weak self] tip in
guard let strongSelf = self else {
return
}
strongSelf.tip = tip
requestUpdate(.immediate)
}).strict()
}
requestUpdateAction = { [weak self] id, action in
guard let self else {
return
@ -981,17 +992,26 @@ public final class ContextControllerActionsListStackItem: ContextControllerActio
if let tip = self.tip {
let tipNode: InnerTextSelectionTipContainerNode
var tipTransition = transition
if let current = self.tipNode {
if let current = self.tipNode, current.tip == tip {
tipNode = current
} else {
tipTransition = .immediate
let previousTipNode = self.tipNode
tipNode = InnerTextSelectionTipContainerNode(presentationData: presentationData, tip: tip, isInline: true)
self.addSubnode(tipNode)
self.tipNode = tipNode
let getController = self.getController
tipNode.requestDismiss = { completion in
getController()?.dismiss(completion: completion)
}
self.addSubnode(tipNode)
self.tipNode = tipNode
if let previousTipNode = previousTipNode {
previousTipNode.animateTransitionInside(other: tipNode)
previousTipNode.removeFromSupernode()
tipNode.animateContentIn()
}
}
let tipSeparatorNode: ContextControllerActionsListSeparatorItemNode
@ -1004,12 +1024,15 @@ public final class ContextControllerActionsListStackItem: ContextControllerActio
}
let (tipSeparatorMinSize, tipSeparatorApply) = tipSeparatorNode.update(presentationData: presentationData, constrainedSize: CGSize(width: combinedSize.width, height: 10.0))
tipSeparatorNode.isHidden = self.itemNodes.isEmpty
let tipSeparatorSize = CGSize(width: combinedSize.width, height: tipSeparatorMinSize.height)
tipSeparatorApply(tipSeparatorSize, tipTransition)
let tipSeparatorFrame = CGRect(origin: nextItemOrigin, size: tipSeparatorSize)
tipTransition.updateFrame(node: tipSeparatorNode, frame: tipSeparatorFrame)
nextItemOrigin.y += tipSeparatorSize.height
combinedSize.height += tipSeparatorSize.height
if !tipSeparatorNode.isHidden {
nextItemOrigin.y += tipSeparatorSize.height
combinedSize.height += tipSeparatorSize.height
}
let tipSize = tipNode.updateLayout(widthClass: .compact, presentation: .inline, width: combinedSize.width, transition: tipTransition)
let tipFrame = CGRect(origin: nextItemOrigin, size: tipSize)

View file

@ -39,6 +39,7 @@ swift_library(
"//submodules/TelegramUI/Components/TelegramAccountAuxiliaryMethods",
"//submodules/TelegramUI/Components/PeerSelectionController",
"//submodules/TelegramUI/Components/ContextMenuScreen",
"//submodules/TelegramUI/Components/NavigationBarImpl",
],
visibility = [
"//visibility:public",

View file

@ -31,6 +31,7 @@ import TelegramUIDeclareEncodables
import TelegramAccountAuxiliaryMethods
import PeerSelectionController
import ContextMenuScreen
import NavigationBarImpl
private var installedSharedLogger = false
@ -194,6 +195,10 @@ public class ShareRootControllerImpl {
public init(initializationData: ShareRootControllerInitializationData, getExtensionContext: @escaping () -> NSExtensionContext?) {
self.initializationData = initializationData
self.getExtensionContext = getExtensionContext
defaultNavigationBarImpl = { presentationData in
return NavigationBarImpl(presentationData: presentationData)
}
}
deinit {

View file

@ -2324,8 +2324,12 @@ public final class ChatHistoryListNodeImpl: ListView, ChatHistoryNode, ChatHisto
}
var keyboardButtonsMessage = view.topTaggedMessages.first
if keyboardButtonsMessage != nil && keyboardButtonsMessage?.threadId != chatLocation.threadId {
keyboardButtonsMessage = nil
if let keyboardButtonsMessageValue = keyboardButtonsMessage {
if keyboardButtonsMessageValue.threadId != chatLocation.threadId {
if chatLocation.threadId != nil {
keyboardButtonsMessage = nil
}
}
}
if let keyboardButtonsMessageValue = keyboardButtonsMessage, keyboardButtonsMessageValue.isRestricted(platform: "ios", contentSettings: context.currentContentSettings.with({ $0 })) {
keyboardButtonsMessage = nil

View file

@ -25,6 +25,7 @@ arch_specific_cflags = select({
"@build_bazel_rules_apple//apple:ios_arm64": common_flags + arm64_specific_flags,
"//build-system:ios_sim_arm64": common_flags + arm64_specific_flags,
"@build_bazel_rules_apple//apple:ios_x86_64": common_flags + x86_64_specific_flags,
"//conditions:default": common_flags,
})
cc_library(

View file

@ -29,6 +29,10 @@ genrule(
BUILD_ARCH="sim_arm64"
elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then
BUILD_ARCH="x86_64"
elif [ "$(TARGET_CPU)" == "k8" ] || [ "$(TARGET_CPU)" == "x86_64" ]; then
BUILD_ARCH="linux_x86_64"
elif [ "$(TARGET_CPU)" == "aarch64" ] || [ "$(TARGET_CPU)" == "arm64" ]; then
BUILD_ARCH="linux_arm64"
else
echo "Unsupported architecture $(TARGET_CPU)"
fi
@ -63,6 +67,20 @@ cc_library(
srcs = [":Public/opus/lib/lib" + x + ".a" for x in libs],
)
cc_library(
name = "opus_cc",
hdrs = [":Public/opus/" + x for x in headers],
includes = [
"Public",
],
deps = [
":opus_lib",
],
visibility = [
"//visibility:public",
],
)
objc_library(
name = "opus",
module_name = "opus",

View file

@ -12,8 +12,6 @@ OPT_CFLAGS="-Os -g"
OPT_LDFLAGS=""
OPT_CONFIG_ARGS=""
DEVELOPER=`xcode-select -print-path`
OUTPUTDIR="$BUILD_DIR/Public"
# where we will keep our sources and build from.
@ -28,7 +26,27 @@ mkdir -p $INTERDIR
tar zxf "$BUILD_DIR/$SOURCE_CODE_ARCHIVE" -C $SRCDIR
cd "${SRCDIR}/opus-"*
if [ "${ARCH}" == "x86_64" ]; then
if [ "${ARCH}" = "linux_x86_64" ] || [ "${ARCH}" = "linux_arm64" ]; then
mkdir -p "${INTERDIR}"
# Keep it simple and portable for container builds.
./configure \
--disable-shared \
--enable-static \
--with-pic \
--disable-extra-programs \
--disable-doc \
--disable-asm \
--enable-intrinsics \
${OPT_CONFIG_ARGS} \
--prefix="${INTERDIR}" \
CFLAGS="$CFLAGS ${OPT_CFLAGS} -fPIC" \
LDFLAGS="$LDFLAGS ${OPT_LDFLAGS}"
make -j"$(getconf _NPROCESSORS_ONLN || echo 4)"
make install
exit 0
elif [ "${ARCH}" == "x86_64" ]; then
PLATFORM="iphonesimulator"
EXTRA_CFLAGS="-arch ${ARCH}"
EXTRA_CONFIG="--host=x86_64-apple-darwin"

View file

@ -355,9 +355,15 @@ absl_sources = [
"absl/types/bad_variant_access.cc",
]
absl_inc_files = [
f
for f in glob(["absl/**/*.inc"])
if f not in absl_headers
]
cc_library(
name = "absl",
hdrs = absl_headers,
hdrs = absl_headers + absl_inc_files,
srcs = absl_sources,
cxxopts = [
"-std=c++17",

View file

@ -6,6 +6,7 @@ arch_specific_crc32c_sources = select({
"//build-system:ios_sim_arm64": [
"third_party/crc32c/src/crc32c_arm64.cc",
],
"//conditions:default": [],
})
crc32c_sources = ["third_party/crc32c/src/" + x for x in [

View file

@ -37,6 +37,7 @@ arm64_specific_flags = [
arch_specific_cflags = select({
"@build_bazel_rules_apple//apple:ios_arm64": common_flags + arm64_specific_flags,
"//build-system:ios_sim_arm64": common_flags + arm64_specific_flags,
"//conditions:default": [],
})
optimization_flags = select({