Re-add missing youtube-native-share 0.2.3

I accidentally reverted this. It should still work as intended.
This commit is contained in:
arichornlover 2024-07-30 11:35:59 -05:00 committed by GitHub
parent d16a0ec73d
commit e91b64b248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,15 +171,16 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor]; YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor];
if (!shareEntityEndpoint.hasSerializedShareEntity) if (!shareEntityEndpoint.hasSerializedShareEntity)
return %orig; return %orig;
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity, self.fromView))
return %orig; return %orig;
} }
%end %end
/* ------------------- iPhone Layout ------------------- */ /* ------------------- iPhone Layout ------------------- */
%hook ELMPBShowActionSheetCommand %hook ELMPBShowActionSheetCommand
- (void)executeWithCommandContext:(id)_context handler:(id)_handler { - (void)executeWithCommandContext:(ELMCommandContext*)context handler:(id)_handler {
if (!self.hasOnAppear) if (!self.hasOnAppear)
return %orig; return %orig;
GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand]; GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand];
@ -192,7 +193,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor]; YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor];
if (!updateShareSheetCommand.hasSerializedShareEntity) if (!updateShareSheetCommand.hasSerializedShareEntity)
return %orig; return %orig;
if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity)) if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity, context.context.fromView))
return %orig; return %orig;
} }
%end %end