As the pgp/mime messages are encrypted together with the message body,
the handling of those attachments needs to be different. The
LocalAttachment objects will contain all the attachment data and can't
be passed around between the activities.
The blocking call is far from perfect but making it async lead to race
conditions- the attachments sometimes would fail to be uploaded
correctly and not show in the attachments screen. As this is a rather
rare type of message, it should not have too much of an impact.
MAILAND-2894
The problem was that we were sending a message that was styled according
to what we show in the app. Instead, for the sending, we need the clean
HTML message body of the parent message when we reply/forward. Initial
message content is the holder of the quoted text (parent message) and
the solution included setting its value to be the clean HTML body of the
parent message.
MAILAND-2847
The pgp/mime messages are encrypted together with the attachments.
What that means is once we have decrypted the message, we already
have the attachments in memory, so there's no need to try to fetch
and decrypt them again.
MAILAND-2848
Observe the 'set up complete' value before fetching the contacts
and don't use a lateinit var for contact groups- as the value would
usually be uninitialised the first time around it was being accessed.
MAILAND-2866
The code was using all the address keys instead of only the primary key
to encrypt the attachments to upload.
This caused the key packet to contain several key packets (since the change in gopenpgp v2.4.3),
which was not accepted by the backend.
We were using a wrongly sorted list to choose the correct address from,
now we use the address list inside the correct user and since the keys
start from 1 and positions from 0 that is why we had to subtract 1.
MAILAND-2846
Worker has limitation of how much data can be passed to it and the
encryptedData we were passing has a tendency to be heavy now we get the
encryptedData of the contact from DB from withing the Worker to avoid
having to pass the data..
MAILAND-2840
This is to minimise confusion when it comes to draft/sent messages being
moved to another location and still showing up in the Drafts/Sent
folders.
MAILAND-2845
The setting was saved and read from different preferences. Fixed
by introducing an account settings repo, to have a single place
of accessing those and hide the shared prefs implementation detail.
MAILAND-2843
Remove the dialog that asks whether to save the draft or not and save
the draft automatically when there are changes in the composer. After
saving it show a snackbar that the draft has been saved and offer an
option to move the draft to trash from the snackbar.
MAILAND-2832
If an empty composer is closed, do not ask if a draft should be saved.
The draft should not be saved if the composer is empty. For now, there
is one limitation to this solution. If the user adds something in the
composer and then removes it, there is no way to check this scenario
reliably and then we'll ask whether the draft should be saved or not.
MAILAND-2832
This is needed as the prefs are cleared after the user is logged in.
This means the app version and the last app version info will be lost
for that installation- in consequence, the next version won't be
recognised correctly as an app update.
MAILAND-2825
MAILAND-2797
The observer is registered only if:
- the app version changes,
- the previous version is earlier than the first v4 beta,
- user is logged in,
- the onboarding was not shown yet.
It listens to the first activity (any) creation after the app has been
created and starts the existing user onboarding activity. Once the
activity is shown, the flag in the prefs is updated accordingly
and the observer removes itself.
MAILAND-2825
The problem was caused by a query to the contacts DB which was checking
the sender/recipient contacts for each message every time the list of
messages is emitted. The mapping of the senders/recipients to the
appropriate contacts is now done in MessageRepository by querying all
the contacts at once, which improved the performance.
MAILAND-2812