Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide richer information when using NSSharingService #1699

Merged
merged 3 commits into from
Jul 8, 2023

Conversation

barijaona
Copy link
Member

@barijaona barijaona commented Jun 26, 2023

Provide title of article in addition to URL
Title is used as sharing service's subject

Unfortunately, NSSharingService is not yet smart enough to pass multiple types of content.

Fix issue #1678

@barijaona barijaona changed the title Provice richer information when using NSSharingService Provide richer information when using NSSharingService Jun 27, 2023
@barijaona barijaona requested a review from Eitot June 27, 2023 02:51
Copy link
Contributor

@Eitot Eitot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this breaks adding an article to Safari Reading List.

@Eitot
Copy link
Contributor

Eitot commented Jul 2, 2023

It seems that NSSharingService simply picks the first result of [Article writableTypesForPasteboard:]. Presently it returns NSPasteboardTypeRTF which works for Mail, but not Safari Reading List. When switching to NSPasteboardTypeURL, Safari Reading List will work but Mail will only share a URL.

@barijaona
Copy link
Member Author

It seems that this breaks adding an article to Safari Reading List.

I see in the log:

[NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement `+_allowedItemPayloadClasses`. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error.

This warning also appears when I use the 'Email link' menu item…
But it does not appear when I use the Share icon and select Mail ?

@barijaona
Copy link
Member Author

OK, I don't want to fight what appears to be AppKit bugs on NSSharingServicePicker and NSPasteboardWriting and will revert to a less sophisticated approach.

Copy link
Contributor

@Eitot Eitot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise. I prefer the narrower scope of the PR without the pasteboard stuff. NSPasteboardWriting has to be done eventually, but it has some annoying pitfalls.

Vienna/Sources/Main window/MainWindowController.swift Outdated Show resolved Hide resolved
Especially useful for the e-mail sharing service
To avoid having default font Times New Roman in Mail.app, I specify
style "font-family:sans-serif" in template.
Remove markup in type string pasteboard items.
@barijaona barijaona merged commit e6aff5f into ViennaRSS:master Jul 8, 2023
1 check passed
@barijaona barijaona deleted the sharingservice branch December 3, 2023 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants