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

Make pgpmime-support known after Mailvelope init #9551

Merged

Conversation

pabzm
Copy link
Member

@pabzm pabzm commented Jul 16, 2024

The support for pgpmime was only checked initially after the login. If a user e.g. authorizes a domain in Mailvelope only after a login, Mailvelope now instantly works, instead of (silently and undocumentedly) requireing a logout+login-cycle.

@pabzm pabzm self-assigned this Jul 16, 2024
@pabzm pabzm requested a review from alecpl July 16, 2024 12:29
@alecpl
Copy link
Member

alecpl commented Jul 21, 2024

This does not look like a best solution. If you take a look at how mailvelope_load() is invoked you'll see that it is only when Mailvelope is enabled. There's no need to call pgpmime_support_check(). It will not set the env variable in some circumstances.

I see three solutions:

  1. I think we should just set rcmail.env.browser_capabilities.pgpmime = 1 in mailvelope_load().
  2. Unset $_SESSION['browser_caps']['pgpmime'] when enabling Mailvelope.
  3. Always check for pgpmime capability as it is not a heavy check (in browser_capabilities_check()).

2nd is not great as it will require an extra http request. From 1. and 3. I have no preference.

@pabzm pabzm force-pushed the make-mailvelope-known-to-browser-after-setup branch from 33f363d to 6fe394a Compare July 23, 2024 10:32
@pabzm
Copy link
Member Author

pabzm commented Jul 23, 2024

I chose the first alternative since it's the most straightforward. Thank you for the hint on my misunderstanding of the code!

program/js/app.js Outdated Show resolved Hide resolved
The support for pgpmime was only checked initially after the login. If a
user e.g. authorizes a domain in Mailvelope only after a login,
Mailvelope now instantly works, instead of (silently and undocumentedly)
requireing a logout+login-cycle.
@pabzm pabzm force-pushed the make-mailvelope-known-to-browser-after-setup branch from 6fe394a to 7b5f476 Compare July 24, 2024 17:23
@pabzm pabzm requested a review from alecpl July 24, 2024 17:29
@alecpl alecpl merged commit 657f397 into roundcube:master Jul 25, 2024
16 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.

2 participants