mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-07-08 00:26:06 +08:00
Image Message Identify QRCode Notification
This commit is contained in:
parent
83b5eac8d6
commit
58ea444d1a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -19,3 +19,4 @@
|
|||
"Tweak.MessageMenuItem.CopyLink" = "Copy Link";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "Open In Browser";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "Identify QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "The result of the recognition has been copied to the pasteboard";
|
||||
|
|
|
@ -19,3 +19,4 @@
|
|||
"Tweak.MessageMenuItem.CopyLink" = "复制链接";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "使用浏览器打开";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "识别二维码";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "识别结果已复制到粘贴板";
|
||||
|
|
|
@ -19,3 +19,4 @@
|
|||
"Tweak.MessageMenuItem.CopyLink" = "複製鏈接";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "使用瀏覽器打開";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "識別QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "識別結果已復製到粘貼板";
|
||||
|
|
|
@ -247,7 +247,18 @@ static void __attribute__((constructor)) tweak(void) {
|
|||
CIQRCodeFeature *result = results.firstObject;
|
||||
NSString *content = result.messageString;
|
||||
if (content.length) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:content]];
|
||||
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||
[pasteboard clearContents];
|
||||
[pasteboard setString:content forType:NSStringPboardType];
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:({
|
||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||
notification.informativeText = [NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCodeNotification"];
|
||||
notification;
|
||||
})];
|
||||
NSURL *url = [NSURL URLWithString:content];
|
||||
if ([url.scheme containsString:@"http"]) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:url];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user