Skip to content

Commit 513d4f2

Browse files
committed
- bugfixes
1 parent 32a454c commit 513d4f2

19 files changed

+84
-46
lines changed

‎Telegram-Mac/ChatInputActionsView.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ class ChatInputActionsView: View {
8181
}, for: .LongMouseDown)
8282

8383

84-
muteChannelMessages.set(handler: { [weak self] _ in
84+
muteChannelMessages.set(handler: { [weak self] control in
8585
if let chatInteraction = self?.chatInteraction {
8686
FastSettings.toggleChannelMessagesMuted(chatInteraction.peerId)
87-
(self?.superview?.superview as? View)?.updateLocalizationAndTheme(theme: theme)
87+
let isMuted = FastSettings.isChannelMessagesMuted(chatInteraction.peerId)
88+
(self?.superview?.superview as? ChatInputView)?.updatePlaceholder()
89+
tooltip(for: control, text: isMuted ? strings().messagesSilentTooltipSilent : strings().messagesSilentTooltip)
8890
}
8991
}, for: .Click)
9092

‎Telegram-Mac/ChatInputView.swift

+4
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,10 @@ class ChatInputView: View, Notifable {
849849
self.textView.placeholder = textPlaceholder
850850
}
851851

852+
func updatePlaceholder() {
853+
self.textView.placeholder = textPlaceholder
854+
}
855+
852856
private func updateAccesory(animated: Bool) {
853857
self.accessory.measureSize(self.frame.width - 40.0)
854858
self.inputDidUpdateLayout(animated: animated)

‎Telegram-Mac/ChatServiceItem.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ class ChatServiceRowView: TableRowView {
24232423
if textLayout.isBigEmoji {
24242424
rect = item.rect
24252425
} else {
2426-
rect = item.rect.insetBy(dx: -2, dy: -2)
2426+
rect = item.rect
24272427
}
24282428
if let item = self.item as? ChatServiceItem, item.isBubbled {
24292429
rect = rect.offsetBy(dx: 9, dy: 2)

‎Telegram-Mac/CoreExtension.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4083,7 +4083,7 @@ func concatMessageAttributes(_ attributes: [MessageTextEntity]) -> [MessageTextE
40834083

40844084
extension TelegramMediaImage {
40854085
convenience init(dimension: PixelDimensions, immediateThumbnailData: Data?) {
4086-
self.init(imageId: .init(namespace: 0, id: 0), representations: [.init(dimensions: dimension, resource: CloudFileMediaResource(datacenterId: 0, volumeId: 0, localId: 0, secret: 0, size: nil, fileReference: nil), progressiveSizes: [], immediateThumbnailData: immediateThumbnailData)], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
4086+
self.init(imageId: .init(namespace: 0, id: 0), representations: [.init(dimensions: dimension, resource: LocalBundleResource(name: "", ext: ""), progressiveSizes: [], immediateThumbnailData: immediateThumbnailData)], immediateThumbnailData: immediateThumbnailData, reference: nil, partialReference: nil, flags: [])
40874087

40884088
}
40894089
}

‎Telegram-Mac/DataAndStorageViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,12 @@ private func entries(state: State, data: DataAndStorageData, proxy: ProxySetting
459459
entries.append(.autoplayVideos(sectionId, autoplayMedia.videos, viewType: .lastItem))
460460

461461

462-
#if DEBUG
463-
entries.append(.sectionId(sectionId))
464-
sectionId += 1
465-
entries.append(.sensitiveContent(sectionId, false, viewType: .singleItem))
466-
entries.append(.sensitiveContentInfo(sectionId, viewType: .textBottomItem))
467-
#endif
462+
// #if DEBUG
463+
// entries.append(.sectionId(sectionId))
464+
// sectionId += 1
465+
// entries.append(.sensitiveContent(sectionId, false, viewType: .singleItem))
466+
// entries.append(.sensitiveContentInfo(sectionId, viewType: .textBottomItem))
467+
// #endif
468468

469469
entries.append(.sectionId(sectionId))
470470
sectionId += 1

‎Telegram-Mac/GalleryThumbsControlView.swift

+8-4
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class GalleryThumbContainer : Control {
123123
addSubview(overlay)
124124
overlay.backgroundColor = .black
125125
layer?.cornerRadius = .cornerRadius
126+
127+
handleScrollEventOnInteractionEnabled = false
126128
}
127129

128130
deinit {
@@ -164,9 +166,11 @@ class GalleryThumbsControlView: View {
164166

165167
documentView.backgroundColor = .clear
166168

169+
self.layer?.cornerRadius = 4
170+
167171

168-
NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.boundsDidChangeNotification, object: scrollView.contentView)
169-
NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.frameDidChangeNotification, object: scrollView)
172+
// NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.boundsDidChangeNotification, object: scrollView.contentView)
173+
//NotificationCenter.default.addObserver(self, selector: #selector(scrollDidUpdated), name: NSView.frameDidChangeNotification, object: scrollView)
170174

171175
}
172176

@@ -200,7 +204,6 @@ class GalleryThumbsControlView: View {
200204

201205
previousRange = range
202206

203-
documentView.subviews = range.location == NSNotFound ? [] : items.subarray(with: range).map { $0.view }
204207
}
205208

206209
override func layout() {
@@ -312,7 +315,8 @@ class GalleryThumbsControlView: View {
312315
scrollView.clipView.scroll(to: NSMakePoint(min(max(items[selectedIndex].frame.midX - frame.width / 2, 0), max(documentView.frame.width - frame.width, 0)), 0), animated: animated && documentView.subviews.count > 0)
313316
}
314317
previousRange = nil
315-
scrollDidUpdated()
318+
documentView.subviews = items.map { $0.view }
319+
316320
}
317321

318322
}

‎Telegram-Mac/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</dict>
3636
</array>
3737
<key>CFBundleVersion</key>
38-
<string>265406</string>
38+
<string>265458</string>
3939
<key>ITSAppUsesNonExemptEncryption</key>
4040
<false/>
4141
<key>LSApplicationCategoryType</key>

‎Telegram-Mac/StoryControlsView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ final class StoryControlsView : Control {
213213
avatarAndText.scaleOnClick = true
214214

215215
avatarAndText.set(handler: { [weak self] control in
216-
if let groupId = self?.groupId {
216+
if let groupId = self?.story?.peer?.id {
217217
self?.arguments?.openPeerInfo(groupId, control)
218218
}
219219
}, for: .Click)

‎Telegram-Mac/StoryListView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ final class StoryListView : Control, Notifable {
993993
if textLayout.isBigEmoji {
994994
rect = item.rect
995995
} else {
996-
rect = item.rect.insetBy(dx: -2, dy: -2)
996+
rect = item.rect
997997
}
998998

999999
let view: InlineStickerItemLayer

‎Telegram-Mac/StoryModalController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -2305,6 +2305,7 @@ final class StoryModalController : ModalViewController, Notifable {
23052305
PeerInfoController.push(navigation: context.bindings.rootNavigation(), context: context, peerId: peerId)
23062306
}
23072307
self?.close()
2308+
closeAllModals(window: context.window)
23082309
}
23092310

23102311
if let view = view, let event = NSApp.currentEvent {

‎Telegram-Mac/VideoRecorderPipeline.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class VideoRecorderPipeline : NSObject, AVCaptureVideoDataOutputSampleBufferDele
120120
audioDevices.insert(device, at: 0)
121121
}
122122

123-
let videoDevice = videoDevices.first(where: { $0.isConnected && !$0.isSuspended})
123+
let videoDevice = videoDevices.filter({ $0.isConnected && !$0.isSuspended }).first(where: { $0.position == .front || $0.position == .unspecified })
124+
124125
let audioDevice = audioDevices.first(where: { $0.isConnected && !$0.isSuspended})
125126

126127

@@ -135,6 +136,7 @@ class VideoRecorderPipeline : NSObject, AVCaptureVideoDataOutputSampleBufferDele
135136
}
136137

137138
videoOutput.alwaysDiscardsLateVideoFrames = false
139+
videoOutput
138140

139141
videoOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_32BGRA, kCVPixelBufferIOSurfacePropertiesKey as String: [:], kCVPixelBufferWidthKey as String: 500, kCVPixelBufferHeightKey as String: 500]
140142

‎Telegram-Mac/WPContentView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class WPContentView: Control, MultipleSelectable, ModalPreviewRowViewProtocol {
360360
if textLayout.isBigEmoji {
361361
rect = item.rect
362362
} else {
363-
rect = item.rect.insetBy(dx: -2, dy: -2)
363+
rect = item.rect
364364
}
365365

366366
let view: InlineStickerItemLayer

‎Telegram-Mac/WebpageModalController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ class WebpageModalController: ModalViewController, WKNavigationDelegate, WKUIDel
16821682

16831683
if self?.isBackButton == true {
16841684
items.append(.init(strings().webAppClose, handler: { [weak self] in
1685-
self?.closeAnyway()
1685+
self?.close()
16861686
}, itemImage: MenuAnimation.menu_clear_history.value))
16871687
}
16881688

328 Bytes
Binary file not shown.

‎TelegramShare/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleShortVersionString</key>
2222
<string>$(MARKETING_VERSION)</string>
2323
<key>CFBundleVersion</key>
24-
<string>265406</string>
24+
<string>265458</string>
2525
<key>ITSAppUsesNonExemptEncryption</key>
2626
<false/>
2727
<key>LSMinimumSystemVersion</key>

‎packages/Localization/Sources/Localization/Localizable.swift

+4
Original file line numberDiff line numberDiff line change
@@ -10471,6 +10471,10 @@ public final class L10n {
1047110471
public static var messagesReplyLoadingHeader: String { return L10n.tr("Localizable", "Messages.ReplyLoading.Header") }
1047210472
/// Loading...
1047310473
public static var messagesReplyLoadingLoading: String { return L10n.tr("Localizable", "Messages.ReplyLoading.Loading") }
10474+
/// subscribers will be notified when you post.
10475+
public static var messagesSilentTooltip: String { return L10n.tr("Localizable", "Messages.Silent.Tooltip") }
10476+
/// subscribers will receive a silent notification.
10477+
public static var messagesSilentTooltipSilent: String { return L10n.tr("Localizable", "Messages.Silent.Tooltip.Silent") }
1047410478
/// Apply
1047510479
public static var modalApply: String { return L10n.tr("Localizable", "Modal.Apply") }
1047610480
/// Cancel

‎packages/TGUIKit/Sources/HorizontalTableView.swift

+44-23
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,40 @@ public class HorizontalTableView: TableView {
1818

1919
self.clipView.border = []
2020
self.tableView.border = []
21+
22+
}
23+
24+
public override func updateAfterInitialize(isFlipped: Bool = true, bottomInset: CGFloat = 0, drawBorder: Bool = false) {
25+
super.updateAfterInitialize(isFlipped: isFlipped, bottomInset: bottomInset, drawBorder: drawBorder)
26+
27+
self.hasHorizontalScroller = false
28+
self.horizontalScrollElasticity = .none
2129
}
2230

23-
public override func scrollWheel(with event: NSEvent) {
24-
31+
32+
33+
override open func scrollWheel(with event: NSEvent) {
34+
35+
if let applyExternalScroll = self.applyExternalScroll, applyExternalScroll(event) {
36+
return
37+
}
38+
2539
var scrollPoint = contentView.bounds.origin
2640
let isInverted: Bool = System.isScrollInverted
27-
2841
if event.scrollingDeltaY != 0 {
2942
if isInverted {
3043
scrollPoint.y += -event.scrollingDeltaY
3144
} else {
3245
scrollPoint.y -= event.scrollingDeltaY
3346
}
47+
scrollPoint.y = max(0, min(scrollPoint.y, listHeight - clipView.bounds.height))
48+
clipView.scroll(to: scrollPoint)
49+
window?.scrollWheel(with: event)
50+
return
3451
}
35-
36-
if event.scrollingDeltaX != 0 {
37-
if !isInverted {
38-
scrollPoint.y += -event.scrollingDeltaX
39-
} else {
40-
scrollPoint.y -= event.scrollingDeltaX
41-
}
52+
if event.scrollingDeltaY != 0 || event.scrollingDeltaX != 0 {
53+
super.scrollWheel(with: event)
4254
}
43-
44-
scrollPoint.y = max(0, min(scrollPoint.y, listHeight - clipView.bounds.height))
45-
clipView.scroll(to: scrollPoint)
46-
4755

4856
}
4957

@@ -99,6 +107,20 @@ public class HorizontalTableView: TableView {
99107

100108

101109
open class HorizontalScrollView : ScrollView {
110+
111+
112+
113+
public override init(frame frameRect: NSRect) {
114+
super.init(frame: frameRect)
115+
self.hasVerticalScroller = false
116+
self.verticalScrollElasticity = .none
117+
}
118+
119+
required public init?(coder: NSCoder) {
120+
fatalError("init(coder:) has not been implemented")
121+
}
122+
123+
102124
override open func scrollWheel(with event: NSEvent) {
103125

104126
if let applyExternalScroll = self.applyExternalScroll, applyExternalScroll(event) {
@@ -113,17 +135,16 @@ open class HorizontalScrollView : ScrollView {
113135
} else {
114136
scrollPoint.x -= event.scrollingDeltaY
115137
}
116-
}
117-
if event.scrollingDeltaX != 0 {
118-
if !isInverted {
119-
scrollPoint.x += -event.scrollingDeltaX
120-
} else {
121-
scrollPoint.x -= event.scrollingDeltaX
122-
}
123-
}
124-
if documentView!.frame.width > frame.width {
125138
scrollPoint.x = min(max(0, floorToScreenPixels(backingScaleFactor, scrollPoint.x)), documentView!.frame.width - frame.width)
126139
clipView.scroll(to: scrollPoint)
140+
window?.scrollWheel(with: event)
141+
return
142+
}
143+
144+
if documentView!.frame.width > frame.width {
145+
if event.scrollingDeltaY != 0 || event.scrollingDeltaX != 0 {
146+
super.scrollWheel(with: event)
147+
}
127148
} else {
128149
superview?.scrollWheel(with: event)
129150
}

‎packages/TGVideoCameraMovie/Sources/TGVideoCameraMovieRecorder.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ + (NSDictionary *)videoSettingsForPreset:(TGMediaVideoConversionPreset)preset di
8282

8383
return @
8484
{
85-
AVVideoCodecKey: AVVideoCodecH264,
85+
AVVideoCodecKey: AVVideoCodecTypeH264,
8686
AVVideoCompressionPropertiesKey: codecSettings,
8787
AVVideoWidthKey: @((NSInteger)dimensions.width),
8888
AVVideoHeightKey: @((NSInteger)dimensions.height)

‎packages/TelegramMedia/Sources/LottiePlayer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class RenderAtomic<T> {
6363
}
6464

6565

66-
public let lottieThreadPool: ThreadPool = ThreadPool(threadCount: 1, threadPriority: 1.0)
66+
public let lottieThreadPool: ThreadPool = ThreadPool(threadCount: 2, threadPriority: 1.0)
6767
public let lottieStateQueue = Queue(name: "lottieStateQueue", qos: .utility)
6868

6969

0 commit comments

Comments
 (0)