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

improve mailto uri handling and support webk2gtk 4.0 and 4.1 #748

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

jorsn
Copy link
Member

@jorsn jorsn commented Jun 4, 2024

fixes #608, fixes #744
closes #745

I would be happy about comments on the mailto handling, which is described below.

mailto uri handling

@larskotthoff How do your problems trying to fix #608 relate to the approach taken here?

  1. This introduces consistent mailto uri handling, supporting passing a body and all headers that can be given as agruments to EditMessage, namely, To, From, Cc, Bcc and Subject. Other headers are not dropped but prepended to the email body with a note.

  2. Positional (i.e., non-option) commandline arguments are now interpreted as --mailto options.

  3. Multiple --mailto options on the commandline are now supported, and are merged into one mailto argument before being passed to EditMessage.

  4. A consequence is that libsoup is not used any more, enabling compatibility with webkit2gtk-4.1 while maintaining compatibility with gio (glib) 2.16, and thus building on older and current distros. Whereas supporting old distros is not necessary, it comes at very low cost: The only feature of newer gio that is used in Use GUri instead of libsoup-2.4 and use webkit2gtk-4.1 #745 is the extraction of the path (To:) part and the query from the uri. But this is simply removing the scheme (mailto:) and splitting at ?.

webkit2gtk 4.0 and 4.1

This is from 7ac8805 by @oreo639, but only the part that is necessary after 4c76a4c.

Version 4.1 is used by default. If this is unavailable, 4.0 is the fallback.

1. This introduces consistent mailto uri handling, supporting passing a
   body and all headers that can be given as agruments to EditMessage,
   namely, To, From, Cc, Bcc and Subject.
   Other headers are not dropped but prepended to the email body with a note.

2. Positional (i.e., non-option) commandline arguments are now
   interpreted as --mailto options.

3. Multiple --mailto options on the commandline are now supported, and are
   merged into one mailto argument before being passed to EditMessage.

4. A consequence is that libsoup is not used any more, enabling
   compatibility with webkit2gtk-4.1 while maintaining compatibility with
   gio (glib) 2.16, and thus building on older and current distros.
This is derived from 7ac8805 by oreo639 <[email protected]>,
but only the part necessary after 4c76a4c.
@jorsn
Copy link
Member Author

jorsn commented Jun 4, 2024

last force-push only fixed the commit message of c72b6fd.

@jorsn
Copy link
Member Author

jorsn commented Jun 18, 2024

@gauteh @oreo639 @ibuclaw If there are no comments comparing this to #745, I will merge this and close #745.

@oreo639
Copy link
Contributor

oreo639 commented Jun 18, 2024

Guri was added in glib 2.66.2 not 2.16 (in the CMakelists.txt)

@jorsn
Copy link
Member Author

jorsn commented Jun 18, 2024

I only use g_uri_parse_scheme and g_uri_unescape_string, which were added in version 2.16, according to the docs.

This is why this PR builds also on Debian bullseye. Not that this is important, but here, I just don't need a newer version.

@oreo639
Copy link
Contributor

oreo639 commented Jun 18, 2024

Ah, alright. Thanks.

@jorsn jorsn merged commit 327d107 into astroidmail:master Jun 18, 2024
6 checks passed
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.

Stop using libsoup2.4 and webkit2gtk 4.0 astroid.desktop doesn't work with mailto: links
2 participants