Commit Graph

145 Commits

Author SHA1 Message Date
Zorica Stojchevska 30e5087084 Update copyright
MAILAND-2696
2022-05-23 21:01:57 +00:00
Maciej Surmacz 990b6d3b1a Refetches the pgp mime messages to get the attachments
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
2022-05-03 11:24:41 +02:00
Maciej Surmacz 3449fdea4f Fixes the contacts not showing in suggestions in composer
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
2022-04-15 10:25:14 +02:00
Maciej Surmacz 72bf6db4e8 Reviews the logs as a first step to clean up sentry
Removes some of the logging when not really needed and adds
filtering function to ignore a number of exceptions we do not care about
2022-04-14 09:59:36 +00:00
Davide Farella 8ca80f902e Create single string for Quote sender header
We were using 2 strings, which was problematic translation for language
which has a different order of the words

L10N-557
2022-04-12 14:10:37 +02:00
Maciej Surmacz 1e4f970d8c Fixes the hyperlink confirmation settings
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
2022-04-11 14:01:44 +00:00
Stefanija Boshkovska 6dfcf4d59c Save the draft when exiting composer instead of showing a dialog with a question
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
2022-04-08 10:35:22 +02:00
Stefanija Boshkovska 0b85a15243 Delete draft when closing an empty composer
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
2022-04-08 10:35:22 +02:00
Davide Farella bb2a73469f Rename PMWebViewClient.kt to PMWebViewClient.kt to respect team
conventions
2022-04-07 15:25:52 +02:00
Davide Farella 3e9733f097 Move Mailbox classes into right packages
MAILAND-1498,
MAILAND-2820
2022-04-07 10:05:06 +00:00
Davide Farella 6562ace99a Remove ComposeMessageViewModel.mergedContactsLiveData
Now, when combined contacts is on, we just fetch groups for every users,
 but following the regular flow

MAILAND-2809
2022-03-29 15:19:32 +00:00
Davide Farella 0be7537f17 Fix labels removed on saving draft
While saving draft, we were removing all the labels, but DRAFT,
ALL_DRAFT and ALL_MAIL

MAILAND-2788
2022-03-23 08:29:47 +00:00
Maciej Surmacz 9d910f7276 Improves error messages for some of the most frequent sentry events 2022-03-22 14:03:10 +00:00
Davide Farella f87428fccf Fix loading of the message body in ComposeMessageActivity.java
MAILAND-2798
2022-03-21 11:03:22 +00:00
Zorica Stojchevska dc2916cd20 Fixes history body not being present when replying from notifications
MAILAND-2755
2022-03-15 13:12:15 +00:00
Zorica Stojchevska 01f0740cc2 Add proper clearing for notification
By adding a use case to clear notification from DB, now we properly
clean up the notifications when dismissing them or opening them.
2022-03-15 13:12:15 +00:00
stefanija 7da9e2ab12 Show the web view in the correct theme when opening the details screen
Take the user preference into consideration when deciding whether to
show the web view in light or dark mode.

MAILAND-2604
2022-02-14 13:02:30 +01:00
stefanija 36363db91b Add a use case that checks whether the app is in dark mode or not
MAILAND-2604
2022-02-14 13:02:30 +01:00
Davide Farella c0cda01542 Improve UX for non existent PM address
Show correct error from BE in the Toast and remove the address

MAILAND-2620
2022-02-11 09:23:35 +00:00
Davide Farella 1a5bafa476 Handle error code and message for FetchPublicKeys.kt
MAILAND-2620
2022-02-11 09:23:35 +00:00
Davide Farella 9bf04a8410 Refactor FetchPublicKeysResult.Success to contain a single entry
MAILAND-2620
2022-02-11 09:23:35 +00:00
Davide Farella 5c26b6ea4c Add Success / Error to FetchPublicKeysResult.kt
MAILAND-2620
2022-02-11 09:23:35 +00:00
Zorica Stojchevska d2608b29fd Solving crash on composer when replying from notification
This also solves double instance of composer remaining in recent when
 replying from notification

MAILAND-2734
MAILAND-2735
2022-02-02 18:15:27 +00:00
Davide Farella 5f0a7b3e4e Clean up after moving Pin Lock
MAILAND-2542
2022-01-24 17:41:32 +01:00
Zorica Stojchevska 4cb549248d Code readability and performance improvements 2022-01-24 13:55:00 +00:00
Zorica Stojchevska 02eed4dc84 Fixes reply and forward with attachments for normal and pgp/mime
messages
2022-01-24 13:55:00 +00:00
Bart Butler 3fbb79fd11 Fix CreateDraftWorker attachment key packet logic 2022-01-24 13:55:00 +00:00
Zorica Stojchevska 5bb7ea0d67 Using the same logic when sharing one attachment or multiple 2022-01-24 13:55:00 +00:00
Zorica Stojchevska 1a3aad6854 Remove unneeded `isDirty` flag from message data builder class 2022-01-24 13:55:00 +00:00
Zorica Stojchevska e5b2e4068a Saving a shared attachment into the DB
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
2022-01-24 13:55:00 +00:00
Davide Farella 1ebeb88a27 Fix crash getting WindowManager in RenderDimensionsProvider.kt
An activity context is required to get the service, thus the Context
cannot be injected with our current configuration
2021-11-23 09:52:00 +00:00
Maciej Surmacz 36f23cbe5a Forces dark mode on the webviews used in the app, for:
- message details,
- quoted message body in composer,
- message printer preview,
when app in the dark mode.

MAILAND-2590
2021-11-18 16:11:42 +01:00
Maciej Surmacz a80d284308 Adds suppress deprecation annotation to the extracted logic classes and removes the UI utils function, replaced with the injectable class.
MAILAND-2443
2021-11-04 14:18:28 +01:00
Marino Meneghel ecde01a6ea Remove fetchmessageDetailsEvent and its observer as never executed
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
2021-11-03 08:23:31 +00:00
Marino Meneghel 657e8cb79c Do not allow editing drafts locally if their remote body can't be fetched
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
2021-11-03 08:23:31 +00:00
Zorica Stojchevska b721fd9356 Introduce dark mode to the web view content of a message
Where:
In message details when reading
In composer when replaying/forwarding
2021-10-26 15:18:26 +02:00
Zorica Stojchevska 842755da2f Changed default snackbar background and text to colors that support dark mode in multiple places 2021-10-25 23:08:48 +02:00
msurmacz 9d253adeda Fixes groups bugs
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
2021-10-20 14:24:04 +02:00
Tomasz Giszczak 2086ac1aab Removed ContactLabelEntity.
MAILAND-1525
2021-10-20 14:20:01 +02:00
Tomasz Giszczak db6ee69762 Labels v4 added.
MAILAND-1525
2021-10-20 14:20:01 +02:00
Tomasz Giszczak f76f8b0aff Renamed Labels objest and updated unit tests.
MAILAND-1525
2021-10-20 14:20:01 +02:00
Marino Meneghel e8ef137ef1 Move SendPreferencesToMessageEncryptionUiModelMapper to composer feature package
MAILAND-1891
2021-10-07 16:41:01 +00:00
Marino Meneghel 58b31cb51a Move ComposerLockIcon to SendPreferencesToEncryptionUiModelMapper
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
2021-10-07 16:41:01 +00:00
Marino Meneghel 3de6686c55 Make messageEncryption field not optional
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
2021-09-21 10:13:47 +00:00
Maciej Surmacz b99804004e Makes sure that the expiration time information is preserved when sending a message
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
2021-09-20 13:57:47 +00:00
Tomasz Giszczak 17ecd77f67 Introduced AddressId from core libraries instead of generic Id used previously.
MAILAND-1430
2021-08-19 12:55:23 +02:00
Tomasz Giszczak ac5484f017 Replaced Id with UserId from core library.
MAILAND-1430
2021-08-19 12:55:23 +02:00
Davide Farella c9cf8b4972 Hide Quote Header in composer when respond inline
MAILAND-2177
2021-08-10 14:17:15 +00:00
Davide Farella 617c6df558 Replace UiUtil.fromHtml with HtmlToSpanned.kt
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
2021-08-10 14:17:15 +00:00
Davide Farella 7bcc08b42c Add anchors to Snackbars
in MailboxActivity.kt and ComposeMessageActivity.java

MAILAND-2245
2021-08-09 16:39:41 +02:00