Commit Graph

200 Commits

Author SHA1 Message Date
Zorica Stojchevska 30e5087084 Update copyright
MAILAND-2696
2022-05-23 21:01:57 +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
Davide Farella 3e9733f097 Move Mailbox classes into right packages
MAILAND-1498,
MAILAND-2820
2022-04-07 10:05:06 +00:00
M. Thiercelin 18d5823e9b Fetch verification keys directly when decrypting body in message details.
Instead of fetching verification keys asynchronously and re-launching decryption
after they are ready, we block the decryption until the keys are fetched.

Also fixes the data transfer between the signature verification process and the
UI for the lock icons.

MAILAND-2046
2022-04-05 09:36:05 +00:00
Davide Farella a6a19a8fd6 Add userId whenever required after ContactsRepository changes
MAILAND-2809
2022-03-29 15:19:32 +00:00
Davide Farella 1d82354068 Fix conflicts after rebase
MAILAND-2788
2022-03-25 14:32:10 +00:00
Davide Farella 7efa1ad726 Reorganize /details/mailbox/presentation is subpackages 2022-03-25 14:32:10 +00:00
Davide Farella da79e8fc64 Use `ALL_DRAFT` and `ALL_SENT` instead of `DRAFT` and `SENT`
MAILAND-2788
2022-03-23 08:29:47 +00:00
Davide Farella e9db5312bc Handle logout on every Activity
Added LogoutHandler.kt, orchestrated by SecurityManager.kt

MAILAND-2639
2022-02-22 09:32:28 +01:00
stefanija b9577e491c Move use cases to the details package
MAILAND-2604
2022-02-14 13:02:30 +01:00
stefanija 6dc41d1087 Show the web view in the correct theme when clicking "View in Light/Dark mode" action
MAILAND-2604
2022-02-14 13:02:30 +01: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 f6d19358dd Fixed errors after conflicts resolution
MAILAND-1585
2022-01-28 12:57:09 +00:00
Davide Farella af59c53173 Fix open answered invitation in Proton Calendar
If the invitation messages has an answer, it `header` will be `null` and it will not be possible to extract the recipient; in that case we, search in the `toLost` for find an address that matches one of the currently primary user's

MAILAND-1585
2022-01-28 12:57:09 +00:00
Davide Farella eea5fce653 Open attachment in Proton Calendar
MAILAND-1585

MAILAND-1585
2022-01-28 12:57:09 +00:00
stefanija 7cb4626664 Fix delete action not working properly when done from the details screen
The issue is that when a message gets deleted, even though that action
returns the user to the mailbox, the view model isn't destroyed on time
and it keeps observing the message in DB. So, when the message is
deleted optimistically from the DB, the observer triggers the getMessage
method which tries to fetch the message again and most of the time
succeeds because the action is not yet registered on the API side. The
fix includes canceling the Job of the Flow which observes and emits the
changes to the message/conversation when the delete action is triggered.

MAILAND-1834
2021-12-28 17:46:14 +01:00
stefanija bc9a8ecf6c Change the order of the parameters of new methods in
ConversationsRepository and ChangeMessagesStarredStatus

MAILAND-2284
2021-11-02 15:22:29 +01:00
stefanija ffe71a89c1 Replace the usages of methods from MessageRepository with the new ChangeMessagesStarredStatus use case
MAILAND-2284
2021-11-02 15:22:29 +01:00
stefanija 72514b418b Replace the usages of methods from MessageDetailsRepository and MessageRepository with the new ChangeMessagesReadStatus use case
MAILAND-2284
2021-11-02 14:39:49 +01:00
stefanija 13d4f1260d Update conversations when performing delete action on messages
This is to make sure the change is reflected optimistically in the mailbox list when we perform the delete action on a message and we are in conversation mode.

MAILAND-2284
2021-11-02 11:48:37 +01: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
stefanija b5563a5f8c Rename method moveLastMessageToTrash to moveToTrash
This method can move a message or conversation to trash. That's why it has been renamed to something more suitable.

MAILAND-2284
2021-10-20 15:59:01 +02:00
stefanija f6883e18eb Fix actions done from the bottom action bar in details screen not reflected in the mailbox list
- The third parameter when calling moveMessagesToFolder in moveLastMessageToTrash in message mode was wrong (the current location of the message).
- Remove the condition that checks whether a conversation has more than one message when performing actions from the bottom action bar in the details screen.

MAILAND-2284
2021-10-20 15:57:43 +02:00
Maciej Surmacz 14159fb806 Removes old import
MAILAND-2443
2021-10-20 14:24:04 +02:00
Tomasz Giszczak 263abf9258 Removed userId from observe/find labels functions which already require label id to be fetched.
MAILAND-1525
2021-10-20 14:24:04 +02:00
Tomasz Giszczak 1e173cba1b Make most of functions from LabelRepository returning domail Label model isntead of LabelEntitiy.
MAILAND-1525
2021-10-20 14:24:04 +02:00
Tomasz Giszczak 231b431b52 Moved message labels related workers to be called from labels repository.
As we have agreeded that we should schedule workers from the repositories this commit moves the calls of message labels workers to label repo, also moves MoveMessagesToFolder to mailbox as it is not direcly labels related.

MAILAND-1525
2021-10-20 14:24:03 +02:00
Tomasz Giszczak 81bdf4a4c0 Converted label repository interface save methods to use Label model from domain layer.
MAILAND-1525
2021-10-20 14:24:03 +02:00
Tomasz Giszczak 82592397bf Moved LabelType to label domain package.
MAILAND-1525
2021-10-20 14:24:02 +02:00
Tomasz Giszczak 60f6c52f67 Moved labels repository and ids to an appropriate package.
MAILAND-1525
2021-10-20 14:24:02 +02:00
Tomasz Giszczak 006629dde0 Fixed some detekt issues and updated the counter.
MAILAND-1525
2021-10-20 14:24:02 +02:00
Tomasz Giszczak ea867aff5b Use PostToLocationWorker in actions sheet to move to differnt folders.
That fixed a crash in previous implementation with jobs.

MAILAND-1525
2021-10-20 14:24:02 +02:00
Tomasz Giszczak 2e8a84c428 Updated Labels package structure.
MAILAND-1525
2021-10-20 14:21:46 +02:00
Tomasz Giszczak 23e672d10e Updated label entity and label id refernces fater rebase.
MAILAND-1525
2021-10-20 14:21:45 +02:00
Tomasz Giszczak 5527954bff Created LabelType enum.
MAILAND-1525
2021-10-20 14:21:45 +02:00
Tomasz Giszczak 7dac46a329 Moved labels related methods from message dao to labels dao and LabelRepository, updated related references.
MAILAND-1525
2021-10-20 14:21:44 +02:00
Tomasz Giszczak 74d50d1cdb Moved labels related stuff to the new package.
MAILAND-1525
2021-10-20 14:20:02 +02:00
Tomasz Giszczak 5cced21bb0 Updated LabelId references in LabelEntity and related.
MAILAND-1525
2021-10-20 14:20:02 +02:00
Tomasz Giszczak f76f8b0aff Renamed Labels objest and updated unit tests.
MAILAND-1525
2021-10-20 14:20:01 +02:00
msurmacz d6786d5830 Makes sure we mark only the latest non-draft item in the current location when marking convo unread
MAILAND-2414
2021-10-20 10:46:19 +00:00
Davide Farella e270110617 Mitigate NPE in MessageDetailsViewModel.onEmbeddedImagesDownloaded
This should mitigate the NPE generated in the mentioned tickets. This should be happening when embedded images are downloaded when the Activity is already closed, so ignoring the absence of value and terminate the process would not negatively affect the users.

Worth to mention is that this should not be happening in a sane LifeCycle, as the `viewModelScope` should be already cancelled when this is happening

MAILAND-2332
MAILAND-2394
2021-10-18 15:08:46 +00:00
Davide Farella 33e640c208 Replace `setImagesAndStartProcess` and `result` in MessageRenderer.kt
Usage replaced by MessageRenderer.setImagesAndProcess

MAILAND-2332
2021-10-18 15:08:46 +00:00
Davide Farella 34d3058406 Replace usages of MessageRenderer.kt with new API
MAILAND-2332
2021-10-18 15:08:46 +00:00
stefanija 35df2e8911 Make the reply actions from the conversation action sheet appear only when there is one message in the details view
MAILAND-2348
2021-09-29 14:27:04 +02:00
msurmacz a5d3aaa4eb Prevents the message from being marked as read when the activity is not visible
This solution is similar to the previous approach however is a little more correct
in the naming and what it does- we don't want to mark a message as read if it is not
visible to the user, as it could not possibly be read by them.

MAILAND-2339
2021-09-20 15:10:26 +00:00
Maciej Surmacz 2b30da4d68 Fixes the messages not being marked as unred from the detail view
The issue was caused by the following sequence of events:
- message is marked as unred,
- this leads to the details view being closed and mailbox view being shown,
- in the meantime, the message is marked as unread in the local db which leads to new emission,
- there is a time window where the detail view activity is still not destroyed and receives the event
with the message, unread, being emitted, even though the view is no longer visible to the user, and
marking this message as read again.

The solution is to ignore the emitted messages/conversations after the details activity has been paused-
this way the unread message will not be incorrectly marked as read when the user is already seing
the mailbox activity.

MAILAND-2339
2021-09-20 15:10:26 +00:00
Maciej Surmacz 11443f7bd2 Uses explicit param name
MAILAND-2334
2021-09-08 14:58:06 +00:00
Maciej Surmacz 2e82269783 Fixes the wrong message being expanded when conversation is loading
Changed the way in which the conversations are loaded from the user's perspective:
- show spinner until the whole conversation is loaded (in order to avoid showing only some
messages that have already been cached in memory),
- show the subject while the data is still loading for a better user experience
Additionally did a small cleanup of the MessageDetailsViewModelTest class.

MAILAND-2334
2021-09-08 14:58:06 +00:00
Marino Meneghel f237af9de3 Message labels are updated locally when conversation "starred" changes
This is needed to avoid an inconsistent state where, till the next
"event" is received all the messages of a conversation that has just
been starred or unstarred would have an updated "isStarred" flag but
out-of-dated "labels" (which would still reflect the previous starred
status.

Within other things, this was causing the UI to be refreshed when the
event with the correct labels was retrieved.

MAILAND-2291
2021-09-08 12:04:13 +02:00