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
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 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
When we would share a file from outside with the app, the attachment was only received with the event but never saved in the DB. So now after we import it with the Worker we also save it in the DB.
MAILAND-2338
fixup! Saving a shared attachment into the DB
Given no value is ever posted on _fetchMessageDetailsEvent, the public
live data fetchmessageDetailsEvent will never emit any values and the
observer in the activity will never be triggered.
MAILAND-2448
This is needed to avoid a state for which opening a draft which body
isn't available in the local DB while in offline mode would show an
infinite loading and force the user to choose whether to save the draft
or not when exiting the composer (both choices would cause the draft's
body loss, on one side because the draft is deleted and on the other
because overridden with the local, empty body available in the
composer).
The change was to move the check for "no connectivity" to the
constructor of the `FetchDraftDetailJob` instead of the `onRun` method
(onRun would not be called when offline due to the `requireNetwork`
constraint of this Job).
When the "failed fetching draft body" event is posted on bus, the
composer reacts by showing an error and closing the itself when user ack
MAILAND-2448
All the groups bugs were caused by the same underlying issue- gson escaping the
"=" character in the label ids when writing them to the db. Fixed by disabling
the html escaping in the custom contact email converter class.
MAILAND-2440
MAILAND-2441
MAILAND-2442
This was done to keep a consistent pattern in how the logic that defines
encryption status across the app is defined (a similar change was
applied to MessageEncryptionUiModelMapper with the main goal to make the
logic testable and more explicit)
This commit doesn't change any behavior.
MAILAND-1891
Since optionality was just used as initial value for this field and all
the logic always assumed the value was there (through force unwrapping
it) we changed it to non-optional to remove the overhead of optional
handling. The initial value is "UNKNOWN".
- Increase MessageDatabase version to 12
MAILAND-1891
The expiration time would get lost along the way when creating a new message:
- first the expiration time would not get copied to the message object from the
_messageDataResult object upon sending,
- then the CreateDraftWorker would overwrite the message in the db with a 0
after receiving a draft from the BE.
The implemented solution fills is in the missing expiration information in the worker
after receiving a response. A better approach, as the next iteration, would be to
make sure we send the expiration time to the BE when creating a draft to start with.
MAILAND-2364
Some CSS was part of the result text, as it's placed in the head, so now we have this single and testable component that makes sure to remove the head before the conversion
MAILAND-2177