Commit Graph

120 Commits

Author SHA1 Message Date
Zorica Stojchevska 30e5087084 Update copyright
MAILAND-2696
2022-05-23 21:01:57 +00: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
Davide Farella 251781d259 Fix exception getting WebViewClient below API 26 in MessageDetailsAdapter.kt
MAILAND-2830
2022-04-07 16:25:58 +02:00
Davide Farella 84cdfc7b5d Implement hyperlink confirmation dialog for phishing messages
MAILAND-2829
2022-04-07 16:25:58 +02:00
Davide Farella c816bf394c Set phishing check in MessageDetailsPmWebViewClient 2022-04-07 16:25:58 +02:00
Davide Farella 84320fd97b Convert MessageDetailsListItem.kt in a sealed class
Sub-classes are now immutable data classes
2022-04-07 16:25:58 +02:00
Davide Farella 44bbbad308 Replace deprecated constructors in MessageDetailsListItem.kt 2022-04-07 15:25:52 +02:00
Davide Farella bb2a73469f Rename PMWebViewClient.kt to PMWebViewClient.kt to respect team
conventions
2022-04-07 15:25:52 +02: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 7efa1ad726 Reorganize /details/mailbox/presentation is subpackages 2022-03-25 14:32:10 +00: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
Davide Farella f6d19358dd Fixed errors after conflicts resolution
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
Davide Farella ee5e71b0fd Show OpenInProtonCalendar when needed
Show the layout if a given Message has any attachment that can be opened with Proton Calendar

MAILAND-1585
2022-01-28 12:57:09 +00:00
Davide Farella f5139d4dc2 Add OpenInProtonCalendar in layout_message_details_body.xml
layout_message_details_web_view.xml renamed to layout_message_details_body.xml

MAILAND-1585
2022-01-28 12:57:09 +00:00
Maciej Surmacz 02a939e584 Adds show history button for single message mode
MAILAND-2646
2021-12-29 13:24:28 +00:00
stefanija d206867181 Use showingMoreThanOneMessage method instead of checking for visible items
MAILAND-2685
2021-12-24 11:45:53 +01:00
Zorica Stojchevska 2021eed5e7 Disable collapsible message details for single message conversation
MAILAND-2685
2021-12-22 18:43:47 +01:00
stefanija 7e902aa04e Stop showing the reply actions below the message body
MAILAND-2653
2021-12-10 14:19:59 +01:00
Maciej Surmacz 83c7b97d8e Review feedback:
- renames the load function to make the nullable return type more explicit,
- extracts a mapper for the message model,
- adds parameter names to the formatMessageHtmlBody param.

MAILAND-2451
2021-11-29 09:32:08 +01:00
stefanija 4197671d06 Fix the appearing and disappearing of reply buttons in details screen
This commit should fix the following issues:
- reply buttons shown before message body is loaded and clicking them
results in a draft with empty body;
- reply buttons are sometimes not shown at all even though the message
body is loaded;
- the action sheet of a message can be summoned in conversation mode
before the message is loaded and we can click the reply buttons from
there which, once again, results in a draft with empty body.

After this commit the behaviour should be such that reply actions and
the button for summoning the in-message action sheet should be
invisible in the cases where the message is not yet loaded and the
message is a draft.

MAILAND-2323
MAILAND-2540
2021-11-22 18:02:25 +01: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
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 2e8a84c428 Updated Labels package structure.
MAILAND-1525
2021-10-20 14:21:46 +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 f76f8b0aff Renamed Labels objest and updated unit tests.
MAILAND-1525
2021-10-20 14:20:01 +02:00
Marino Meneghel 69e28cf9fb Rename GetEncryptionStatus to MessageEncryptionUiMapper
Since the logic this class contains is basically a mapping from a domain
model (MessageEncryption) to a UI one.

MAILAND-1891
2021-10-07 16:41:01 +00:00
Marino Meneghel 07da55d8a3 Shift existing logic from SenderLockIcon to GetEncryptionStatus
This was done with a "lift and shift" approach, without performing any
manual changes to the logic.
It will get refactored by the subsequent commits.

MAILAND-1891
2021-10-07 16:41:01 +00:00
Marino Meneghel 4ae95ad439 Test encryption status of message sent with e2ee is correctly represented
MAILAND-1891
2021-10-07 16:41:01 +00:00
Marino Meneghel 5bf3fdedf0 Encryption status shows checkmark on lock when signature was verified
- Introduce the concept of `SignatureVerification` since based on the
  existing verification logic, signature can be both successfully
  verified, failed or unknown. This is given by the fact that the
  properties of message currently used to infer verification
  (`hasValidSignature` / `hasInvalidSignature`) can both be false.

MAILAND-1891
2021-10-07 16:41:01 +00:00
Marino Meneghel e9db8bd1db Wrap SenderLockIcon into GetEncryptedStatus use case
this allows us to get the "padlocks" logic covered with tests
progressively. The final goal is to drop the SenderLockIcon object and
only use GetEncryptedStatus instead.

MAILAND-1891
2021-10-07 16:41:01 +00:00
msurmacz d46f53f2e2 Renames an adapter property based on the review feedback
MAILAND-2361
2021-10-07 15:35:30 +00:00
msurmacz da05389594 Improves the previous solution
The improvement relies less on the lenght of the delay, as we introduce a retry
mechanism when wrapping message content height, in case the content has not been loaded
after the initial delay period. Additionally moves some code around and uses better names.

MAILAND-2361
2021-10-07 15:35:30 +00:00
msurmacz a06cb34de9 Expands the loading message body as a placeholder
Expands the body of the message before the content is loaded in order to allow snapping of the top of the message
to the top of the screen. The body then collapses with a delay to match the actual message body height.

MAILAND-2361
2021-10-07 15:35:30 +00:00
stefanija 101543beeb Make sure the reply actions are shown only when the message body is loaded
MAILAND-2348
2021-09-29 14:27:05 +02:00
stefanija 912eb767bc Connect the reply buttons from ReplyActionsView to the replying logic
MAILAND-2348
2021-09-29 14:27:04 +02:00
stefanija fdaaee256c Create the ReplyActionsView and add it to the details screen
A new view containing reply, reply all and forward actions has been added to the details screen.

MAILAND-2348
2021-09-29 14:27:04 +02:00
stefanija 68cee8d4d3 Remove the reply action from the MessageDetailsActionsView
MAILAND-2348
2021-09-29 14:27:04 +02:00
Maciej Surmacz dee0fa17d8 Adds expiration icon to the collapsed message view
Adds the expiration view to the collapsed messages, which shows the icon and the
time using the largest available time unit, e.g. 7days 6hours will be shown as 7D.
In addition, updates the mockk to the most recent version.

MAILAND-2236
2021-09-08 14:35:54 +00:00
stefanija c7872fba99 Provide embeddedImageIds to the startDownloadEmbeddedImagesJob method in MessageDetailsViewModel, instead of taking the list from the message object
The problem was that embeddedImageIds in Message is being set when decryption of the message is done. In the scenario where we click on the button in order to load embedded images, the message object that was passed to the startDownloadEmbeddedImagesJob didn't have the embeddedImageIds field set because when decryption was done it was not done on that particular instance of the Message object. The solution is to save the list of embeddedImageIds in the MessageDetailsListItem for each message at the time of loading/decrypting the message, and then use it when the button for loading embedded images is clicked.

MAILAND-2324
2021-09-03 18:11:49 +02:00
Maciej Surmacz e9e5b797eb Merges the conversation flow with label fetching
This way we avoid race conditions in which the labels are emitted after the
UI is refreshed for the last time, which would lead to no collapsed labels being
shown to the user (since the label emission did trigger the UI update).

MAILAND-2255
2021-08-25 17:23:09 +02:00
Maciej Surmacz 9402200fa9 Adds labels to the collapsed message view
Introduces the new components and modifies existing in order to bring the labels to the
collapsed message view. In addition, removes the old attachment icon and replaces it with
the new one, in places where the old one was still being used.

MAILAND-2255
2021-08-25 17:23:09 +02:00
Zorica Stojchevska 33d5e69ea2 Communicate to the message adapter is the message has a decryption error and show a visual representation for it.
MAILAND-2283
2021-08-24 15:05:53 +00:00
Tomasz Giszczak 118b4251c3 Introduced LabelId to replace previously used generic Id (used mainly by LabelChipUiModel).
MAILAND-1430
2021-08-19 12:55:23 +02:00
Marino Meneghel 02a952fd6e MessageDetail hides the bottom bar when showing a converation that only contains a draft
This is a workaround that we agreed on applying for a time tradeoff.
Opening the composer directly with the draft message contained in the
conversation had some technical challenges which are documented in
MAILAND-2248

MAILAND-2224
2021-08-10 10:14:58 +00:00
Marino Meneghel 6bf310349c Revert "Remove `DUMMY_URL_PREFIX` as "http://androidlinksfix.protonmail.com" from MessageDetailsAdapter.kt"
This reverts commit 88de93ca18.

Commit 88de93 was an attempt to fix MAILAND-1801, but dropping the
"DUMMY_URL_PREFIX" had some unintended side effects.

One is that the `webview.reload` call performed to load a message's
remote content stops working properly, reloading to a blank message
instead of reloading the existing HTML content.

This bad behavior reloading only happens when the history of a
message was being displayed (MAILAND-2220).

That seem to happen because the default url for `loadDataWithBaseURL` is
"about:blank"

MAILAND-2220
2021-08-09 12:52:26 +00:00
Marino Meneghel 189bb3b623 Replying to a conversation replies to the last message which is not a draft
both when executed from "more actions" menu and from "bottom bar".
The same applies for reply all and forward actions.

- Conversation Details expands the last message that is not a draft

Moved the responsibility to decide which message is expanded when
the adapter is inited from the `ExpandableRecyclerAdapter` to
`MessageDetailsAdapter`, to allow checking in the message state and
avoid expanding draft messages.

The above, on top of being the desired behavior, was needed to ensure
that when replying to a conversation the body and `decryptedHtml` fields
of the last message that is not a draft had actually been loaded (as
they are needed to pass the "quoted text" over to the composer for
replying / forwarding).

MAILAND-2199
2021-07-30 12:05:20 +02:00
Marino Meneghel 031e0f3a82 Display unread messages as bold in conversation mode
MAILAND-2165
2021-07-28 14:47:51 +02:00
Marino Meneghel 61c49e0408 A collapsed Message in a Conversation only takes up one line
MAILAND-2165
2021-07-28 14:47:51 +02:00