about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/kotato-10.12-sdk.patch
blob: d603c967cfde2b2ace4fc8fb4a97049f061e8191 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
diff --git a/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm b/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
index 337055443..09604b117 100644
--- a/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/file_bookmark_mac.mm
@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 
 #include <Cocoa/Cocoa.h>
 #include <CoreFoundation/CFURL.h>
+#undef check
 
 namespace Platform {
 namespace {
diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm
index 3b4395ae3..7f8ee401f 100644
--- a/Telegram/SourceFiles/platform/mac/specific_mac.mm
+++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm
@@ -119,6 +119,7 @@ PermissionStatus GetPermissionStatus(PermissionType type) {
 	switch (type) {
 	case PermissionType::Microphone:
 	case PermissionType::Camera:
+#if 0
 		const auto nativeType = (type == PermissionType::Microphone)
 			? AVMediaTypeAudio
 			: AVMediaTypeVideo;
@@ -133,6 +134,7 @@ PermissionStatus GetPermissionStatus(PermissionType type) {
 					return PermissionStatus::Denied;
 			}
 		}
+#endif
 		break;
 	}
 	return PermissionStatus::Granted;
@@ -142,6 +144,7 @@ void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCal
 	switch (type) {
 	case PermissionType::Microphone:
 	case PermissionType::Camera:
+#if 0
 		const auto nativeType = (type == PermissionType::Microphone)
 			? AVMediaTypeAudio
 			: AVMediaTypeVideo;
@@ -152,6 +155,7 @@ void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCal
 				});
 			}];
 		}
+#endif
 		break;
 	}
 	resultCallback(PermissionStatus::Granted);
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
index a537929c8..82ef2b837 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_formatter_item.h
@@ -9,8 +9,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 
 #import <AppKit/NSPopoverTouchBarItem.h>
 #import <AppKit/NSTouchBar.h>
+#undef check
 
-API_AVAILABLE(macos(10.12.2))
 @interface TextFormatPopover : NSPopoverTouchBarItem
 - (id)init:(NSTouchBarItemIdentifier)identifier;
 @end
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
index c6a4b886f..d2e0936c0 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_pinned_chats_item.h
@@ -8,12 +8,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #pragma once
 
 #include <AppKit/NSImageView.h>
+#undef check
 
 namespace Main {
 class Session;
 } // namespace Main
 
-API_AVAILABLE(macos(10.12.2))
 @interface PinnedDialogsPanel : NSImageView
 - (id)init:(not_null<Main::Session*>)session
 	destroyEvent:(rpl::producer<>)touchBarSwitches;
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
index 27b04467c..b1a7dfbd9 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/items/mac_scrubber_item.h
@@ -9,12 +9,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 
 #import <AppKit/NSPopoverTouchBarItem.h>
 #import <AppKit/NSTouchBar.h>
+#undef check
 
 namespace Window {
 class Controller;
 } // namespace Window
 
-API_AVAILABLE(macos(10.12.2))
 @interface StickerEmojiPopover : NSPopoverTouchBarItem<NSTouchBarDelegate>
 - (id)init:(not_null<Window::Controller*>)controller
 	identifier:(NSTouchBarItemIdentifier)identifier;
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
index ec4596c67..972461aef 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_audio.h
@@ -8,8 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #pragma once
 
 #import <AppKit/NSTouchBar.h>
+#undef check
 
-API_AVAILABLE(macos(10.12.2))
 @interface TouchBarAudioPlayer : NSTouchBar<NSTouchBarDelegate>
 - (rpl::producer<>)closeRequests;
 @end
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
index 52b54de12..ac3857f9b 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_common.h
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 
 #import <AppKit/NSImage.h>
 #import <Foundation/Foundation.h>
+#undef check
 
 namespace TouchBar {
 
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
index 1cc8c832f..c2178c975 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_controls.h
@@ -20,19 +20,19 @@ struct TrackState;
 
 namespace TouchBar {
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSButton *CreateTouchBarButton(
 	NSImage *image,
 	rpl::lifetime &lifetime,
 	Fn<void()> callback);
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSButton *CreateTouchBarButton(
 	const style::icon &icon,
 	rpl::lifetime &lifetime,
 	Fn<void()> callback);
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSButton *CreateTouchBarButtonWithTwoStates(
 	NSImage *icon1,
 	NSImage *icon2,
@@ -41,7 +41,7 @@ NSButton *CreateTouchBarButtonWithTwoStates(
 	bool firstState,
 	rpl::producer<bool> stateChanged = rpl::never<bool>());
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSButton *CreateTouchBarButtonWithTwoStates(
 	const style::icon &icon1,
 	const style::icon &icon2,
@@ -50,14 +50,14 @@ NSButton *CreateTouchBarButtonWithTwoStates(
 	bool firstState,
 	rpl::producer<bool> stateChanged = rpl::never<bool>());
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSSliderTouchBarItem *CreateTouchBarSlider(
 	NSString *itemId,
 	rpl::lifetime &lifetime,
 	Fn<void(bool, double, double)> callback,
 	rpl::producer<Media::Player::TrackState> stateChanged);
 
-[[nodiscard]] API_AVAILABLE(macos(10.12.2))
+[[nodiscard]]
 NSCustomTouchBarItem *CreateTouchBarTrackPosition(
 	NSString *itemId,
 	rpl::producer<Media::Player::TrackState> stateChanged);
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
index f03546eaf..bc8c63678 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_main.h
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #pragma once
 
 #import <AppKit/NSTouchBar.h>
+#undef check
 
 namespace Window {
 class Controller;
@@ -21,7 +22,6 @@ const auto kPopoverPickerItemIdentifier = @"pickerButtons";
 
 } // namespace TouchBar::Main
 
-API_AVAILABLE(macos(10.12.2))
 @interface TouchBarMain : NSTouchBar
 - (id)init:(not_null<Window::Controller*>)controller
 	touchBarSwitches:(rpl::producer<>)touchBarSwitches;
diff --git a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
index 464f87c9c..9a008c75e 100644
--- a/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
+++ b/Telegram/SourceFiles/platform/mac/touchbar/mac_touchbar_manager.h
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #pragma once
 
 #import <AppKit/NSTouchBar.h>
+#undef check
 
 namespace Main {
 class Domain;
@@ -17,7 +18,6 @@ namespace Window {
 class Controller;
 } // namespace Window
 
-API_AVAILABLE(macos(10.12.2))
 @interface RootTouchBar : NSTouchBar<NSTouchBarDelegate>
 - (id)init:(rpl::producer<bool>)canApplyMarkdown
 	controller:(not_null<Window::Controller*>)controller
Submodule Telegram/ThirdParty/tgcalls contains modified content
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
index 8a4417b..2d9794e 100644
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoDecoderFactory.mm
@@ -71,7 +71,7 @@
     if (@available(iOS 11.0, *)) {
         [result addObject:h265Info];
     }
-#else // WEBRTC_IOS
+#elif 0 // WEBRTC_IOS
     if (@available(macOS 10.13, *)) {
         [result addObject:h265Info];
     }
@@ -101,7 +101,7 @@
       return [[TGRTCVideoDecoderH265 alloc] init];
     }
   }
-#else // WEBRTC_IOS
+#elif 0 // WEBRTC_IOS
   if (@available(macOS 10.13, *)) {
     if ([info.name isEqualToString:kRTCVideoCodecH265Name]) {
       return [[TGRTCVideoDecoderH265 alloc] init];
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
index 2901417..ac9ec2a 100644
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/TGRTCDefaultVideoEncoderFactory.mm
@@ -76,7 +76,7 @@
       [result addObject:h265Info];
     }
   }
-#else // WEBRTC_IOS
+#elif 0 // WEBRTC_IOS
   if (@available(macOS 10.13, *)) {
     if ([[AVAssetExportSession allExportPresets] containsObject:AVAssetExportPresetHEVCHighestQuality]) {
       [result addObject:h265Info];
@@ -112,7 +112,7 @@
       return [[TGRTCVideoEncoderH265 alloc] initWithCodecInfo:info];
     }
   }
-#else // WEBRTC_IOS
+#elif 0 // WEBRTC_IOS
   if (@available(macOS 10.13, *)) {
     if ([info.name isEqualToString:kRTCVideoCodecH265Name]) {
       return [[TGRTCVideoEncoderH265 alloc] initWithCodecInfo:info];
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
index de92427..9a5b20d 100644
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoCameraCapturerMac.mm
@@ -507,8 +507,7 @@ static tgcalls::DarwinVideoTrackSource *getObjCVideoSource(const rtc::scoped_ref
 - (void)captureOutput:(AVCaptureOutput *)captureOutput
     didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
          fromConnection:(AVCaptureConnection *)connection {
-  NSString *droppedReason =
-      (__bridge NSString *)CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_DroppedFrameReason, nil);
+  NSString *droppedReason = nil;
   RTCLogError(@"Dropped sample buffer. Reason: %@", droppedReason);
 }
 
diff --git a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
index bcabcf7..de7b6c7 100644
--- a/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
+++ b/Telegram/ThirdParty/tgcalls/tgcalls/platform/darwin/VideoMetalViewMac.mm
@@ -245,9 +245,11 @@ private:
     layer.framebufferOnly = true;
     layer.opaque = false;
 //    layer.cornerRadius = 4;
+#if 0
     if (@available(macOS 10.13, *)) {
         layer.displaySyncEnabled = NO;
     }
+#endif
 //    layer.presentsWithTransaction = YES;
     layer.backgroundColor = [NSColor clearColor].CGColor;
     layer.contentsGravity = kCAGravityResizeAspectFill;
@@ -334,9 +336,7 @@ private:
 - (RTCVideoRotation)rtcFrameRotation {
     if (_rotationOverride) {
         RTCVideoRotation rotation;
-        if (@available(macOS 10.13, *)) {
-            [_rotationOverride getValue:&rotation size:sizeof(rotation)];
-        } else {
+        {
             [_rotationOverride getValue:&rotation];
         }
         return rotation;
Submodule Telegram/lib_base contains modified content
diff --git a/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm b/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
index 5491702..32befc6 100644
--- a/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
+++ b/Telegram/lib_base/base/platform/mac/base_global_shortcuts_mac.mm
@@ -128,6 +128,7 @@ bool Available() {
 }
 
 bool Allowed() {
+#if 0
 	if (@available(macOS 10.15, *)) {
 		// Input Monitoring is required on macOS 10.15 an later.
 		// Even if user grants access, restart is required.
@@ -141,6 +142,7 @@ bool Allowed() {
 		return AXIsProcessTrustedWithOptions(
 			(__bridge CFDictionaryRef)options);
 	}
+#endif
 	return true;
 }
 
diff --git a/Telegram/lib_base/base/platform/mac/base_info_mac.mm b/Telegram/lib_base/base/platform/mac/base_info_mac.mm
index 29e368f..ea1f65f 100644
--- a/Telegram/lib_base/base/platform/mac/base_info_mac.mm
+++ b/Telegram/lib_base/base/platform/mac/base_info_mac.mm
@@ -203,16 +203,20 @@ void Finish() {
 }
 
 void OpenInputMonitoringPrivacySettings() {
+#if 0
 	if (@available(macOS 10.15, *)) {
 		IOHIDRequestAccess(kIOHIDRequestTypeListenEvent);
 	}
+#endif
 	[[NSWorkspace sharedWorkspace] openURL:PrivacySettingsUrl("Privacy_ListenEvent")];
 }
 
 void OpenDesktopCapturePrivacySettings() {
+#if 0
 	if (@available(macOS 11.0, *)) {
 		CGRequestScreenCaptureAccess();
 	}
+#endif
 	[[NSWorkspace sharedWorkspace] openURL:PrivacySettingsUrl("Privacy_ScreenCapture")];
 }
 
diff --git a/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm b/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
index c86ac77..b081162 100644
--- a/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
+++ b/Telegram/lib_base/base/platform/mac/base_system_media_controls_mac.mm
@@ -271,6 +271,7 @@ void SystemMediaControls::setThumbnail(const QImage &thumbnail) {
 	if (thumbnail.isNull()) {
 		return;
 	}
+#if 0
 	if (@available(macOS 10.13.2, *)) {
 		const auto copy = thumbnail;
 		[_private->info
@@ -284,6 +285,7 @@ void SystemMediaControls::setThumbnail(const QImage &thumbnail) {
 			forKey:MPMediaItemPropertyArtwork];
 		updateDisplay();
 	}
+#endif
 }
 
 void SystemMediaControls::setDuration(int duration) {
@@ -302,10 +304,12 @@ void SystemMediaControls::setVolume(float64 volume) {
 }
 
 void SystemMediaControls::clearThumbnail() {
+#if 0
 	if (@available(macOS 10.13.2, *)) {
 		[_private->info removeObjectForKey:MPMediaItemPropertyArtwork];
 		updateDisplay();
 	}
+#endif
 }
 
 void SystemMediaControls::clearMetadata() {
@@ -367,9 +371,11 @@ bool SystemMediaControls::volumeSupported() const {
 }
 
 bool SystemMediaControls::Supported() {
+#if 0
 	if (@available(macOS 10.12.2, *)) {
 		return true;
 	}
+#endif
 	return false;
 }
 
Submodule Telegram/lib_webrtc contains modified content
diff --git a/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm b/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
index 21e93f7..10a3890 100644
--- a/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
+++ b/Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
@@ -397,6 +397,7 @@ void MacMediaDevices::videoInputRefreshed() {
 }
 
 bool MacDesktopCaptureAllowed() {
+#if 0
 	if (@available(macOS 11.0, *)) {
 		// Screen Recording is required on macOS 10.15 an later.
 		// Even if user grants access, restart is required.
@@ -421,6 +422,7 @@ bool MacDesktopCaptureAllowed() {
 		CFRelease(stream);
 		return true;
 	}
+#endif
 	return true;
 }