mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-13 08:10:22 +00:00
Exclude YTShareRequestViewController (uYouPlusPatches.xm)
This commit is contained in:
parent
70d73a31e4
commit
f535c919ca
1 changed files with 18 additions and 1 deletions
|
|
@ -148,13 +148,30 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) {
|
|||
|
||||
/* -------------------- iPad Layout -------------------- */
|
||||
|
||||
/*
|
||||
%hook YTShareRequestViewController
|
||||
- (id)initWithService:(id)_service parentResponder:(id)_parentResponder {
|
||||
// disable the default share sheet behavior and force the app to call [YTAccountScopedCommandRouter handleCommand]
|
||||
return NULL;
|
||||
}
|
||||
%end
|
||||
*/
|
||||
|
||||
%hook YTAccountScopedCommandRouter
|
||||
- (BOOL)handleCommand:(id)command entry:(id)_entry fromView:(id)_fromView sender:(id)_sender completionBlock:(id)_completionBlock {
|
||||
GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint];
|
||||
if (![command hasExtension:shareEntityEndpointDescriptor])
|
||||
return %orig;
|
||||
YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor];
|
||||
if(!shareEntityEndpoint.hasSerializedShareEntity)
|
||||
return %orig;
|
||||
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity))
|
||||
return %orig;
|
||||
return TRUE;
|
||||
}
|
||||
%end
|
||||
|
||||
/* EXPERIMENTAL
|
||||
%hook YTAccountScopedCommandRouter
|
||||
- (BOOL)handleCommand:(id)command entry:(id)_entry fromView:(id)_fromView sender:(id)_sender completionBlock:(id)_completionBlock {
|
||||
GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint];
|
||||
|
|
@ -170,7 +187,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) {
|
|||
return TRUE;
|
||||
}
|
||||
%end
|
||||
|
||||
*/
|
||||
|
||||
/* ------------------- iPhone Layout ------------------- */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue