This prevents a vulnerability where a malicious actor could craft
a message which would cause a leak of personal information
(such as IP address, browser info and OS) upon opening.
MAILAND-3104
Adding the local and remote attachments might lead to duplicated
attachments, potentially. At the time of sending, the local and
remote attachments should be the same.
MAILAND-3070
The remote attachments are added to the local ones in order to avoid
sending failures wherein the attachments on the BE are different than
the ones on the client side.
MAILAND-3070
* After the recent 3.0.0 update, which included a bump to targetSdk 31,
we've noticed some crashes when microG was disabled
* The stacktrace pointed to PendingIntent mutability flags, which are
required for targetSdk 31
Some details with stacktrace: https://gitlab.com/CalyxOS/calyxos/-/issues/1056
Test: Install ProtonMail on a device with microG as a system app, and with it disabled
Current stable release (3.0.2) will crash with the above stack trace
A build with this patch will work fine
This avoids users which are part of an organization but not admins,
to be presented with an error when they open the subscriptions menu (due
to missing permissions).
MAILAND-3081
This tests that internet connection is up and running, avoiding cases
such as having an active VPN connection with no internet access to
result as having connectivity.
MAILAND-3074
As from the docs, the isConnectedOrConnecting method "is good for
applications that need to do anything related to the network other than
read or write data. For the latter, call isConnected() instead, which
guarantees that the network is fully usable.".
In the cases used by this method, we want to have a fully working network
as the usage is to transfer data.
https://developer.android.com/reference/android/net/NetworkInfo#isConnected()
MAILAND-3074
Due to the way we rely on AlarmManager as a cron system to schedule new jobs to
fetch updates from event loop, when offline, it might happen that
multiple instances of the same job (FetchUpdateJob) are enqueued one
after the other, resulting in duplicated API calls when back online.
Here, we cancel any pre-existing "FetchUpdateJob" job before adding a
new one to the queue.
MAILAND-3074
by setting the feature flag to false.
This is not a guarantee that the rate app dialog was shown,
as the final decision on whether to show the "rate app dialog"
or not is done by google play lib based on "API usage quota"
(the rate dialog can only be shown so many times in a given timeframe).
MAILAND-3071
The current conditions for the dialog to show is for the feature flag to
be true, the user to have seen mailbox screen twice in the same
session and to not being resuming the app from the background (which is
achieved by incrementing the "mailbox screen views" count only when
going back from a Detail screen).
MAILAND-3071
This count will be used to define when a user can be presented with the
"rate app" dialog. We increase the count when going back from the detail
rather than at some point in the mailbox screen's lifecycle to avoid the
case where the dialog is shown when resuming mailbox from the
background.
MAILAND-3071
This prevents users from dismissing the dialog (with the back button or
tapping outside of it) and triggering a draft update with no content
when exiting the composer (causing the loss of the draft).
CLIENT-4905
On low connectivity, opening a draft for the first time (meaning
its body was never fetched) and the exiting the composer before such
loading finished, would cause the draft to be updated with the local
content of the body - empty - causing its loss.
This commit introduces a flag that's set when the VM schedules the
"fetchDraftDetailJob" and reset when such job returns any result
(success or failure). When the user exits the composer, this flag is
checked and if found set the draft will not be saved.
CLIENT-4905