Commit Graph

85 Commits

Author SHA1 Message Date
Zorica Stojchevska 30e5087084 Update copyright
MAILAND-2696
2022-05-23 21:01:57 +00:00
Maciej Surmacz b16d89ba37 Re-arranges packages of the pending action code
MAILAND-2789
2022-03-24 10:34:19 +00:00
Zorica Stojchevska 4cb549248d Code readability and performance improvements 2022-01-24 13:55:00 +00:00
Zorica Stojchevska cc2cfc2123 Delete all attachments tied to a message when we delete the message
MAILAND-2338
2022-01-24 13:55:00 +00:00
Zorica Stojchevska 2034e02e0f Removed some unused code 2022-01-24 13:55:00 +00:00
stefanija 1f6637efc7 Improve DeleteMessage use case
Make findPendingSendByMessageId and findPendingUploadByMessageId suspend
functions and remove withContext.

MAILAND-1834
2021-12-28 16:13:14 +01:00
stefanija e5bb244109 Add a method in MessageRepository that enqueues EmptyFolderRemoteWorker
This method enqueues EmptyFolderRemoteWorker and deletes local messages
optimistically.

MAILAND-2571
2021-11-19 15:24:45 +01:00
Neil Marietta 53aee71c11 Fixed various App freezes and crashes. 2021-11-08 12:27:24 +00: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
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 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 79cb20d2e6 Removed unused observing and setting of labelse in Mailbox and Search activities.
MAILAND-1525
2021-10-20 14:24:03 +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 2e8a84c428 Updated Labels package structure.
MAILAND-1525
2021-10-20 14:21:46 +02:00
Tomasz Giszczak 8a08618e9a Added refresh labels parameter to LabelRepository observe and fetch all methods, removed old labels fetching logic from MessagesService and related.
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 05edc1955b Moved Labels entity to new single db. Updated exclusive field.
MAILAND-1525
2021-10-20 14:20:02 +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 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
Davide Farella 880ffacf24 Remove MessageDao.searchMessagesBlocking
MAILAND-2089
2021-09-03 09:06:38 +00:00
Davide Farella 967a1bca93 Use ProtonStore.kt for MessageRepository.observeMessages
MAILAND-2089
2021-09-03 09:06:38 +00:00
Marino Meneghel 8ca4f3ec10 Unstarring a message removes the "starred" label locally
As "starred" status is defined by the presence of the "starred" label ID
(10) in the message's labels list, when un-starring a message we remove
this label.

The `isStarred` flag which is also being changed together with this, is
just an old "utility" flag and shouldn't be used going forward (we
should rely on labels as source of thruth instead)

- An attempt to unit test this in a similar way as in `67f84f41be1804`
  was done by changing the PostUnstarJob to get the `CounterDatabase`
  injected (through DatabaseProvider) but that was dropped as it
  eventually causes some issues with Job serialization and the test
  didn't add enoguh value to justify the migration of this Job.

MAILAND-2234
2021-08-25 16:02:54 +00:00
Tomasz Giszczak ac5484f017 Replaced Id with UserId from core library.
MAILAND-1430
2021-08-19 12:55:23 +02:00
Marino Meneghel 0b53883a41 Delete unused methods
MAILAND-1931
2021-06-30 15:47:31 +00:00
Davide Farella 1b7e483538 Solve conflicts after v4 attachments revert
MAILAND-2044
2021-06-29 15:56:43 +02:00
Marino Meneghel bc39f06832 Remove unused methods from MessageDao
and adapt unit tests to check the non-blocking versions of such methods.
MessageDaoTest were failing because of [this
issue](https://github.com/Kotlin/kotlinx.coroutines/issues/1222) so
changed runBlockingTest with runBlocking
2021-06-25 14:57:47 +00:00
Tomasz Giszczak 701778129d GetMessagesByLocation usecase added.
MAILAND-1971
2021-06-23 12:12:19 +00:00
stefanija da53fcd846 Add methods for starring/unstarring conversations in ConversationsRepository
MAILAND-1440
2021-06-16 14:35:16 +02:00
Marino Meneghel 6458a8c9be Minor code formatting
MAILAND-1767
2021-06-14 17:31:33 +02:00
Marino Meneghel 17f3d6251a Introduce ConversationUiModel to break Detail View dependency on Message model
MAILAND-1767
2021-06-14 17:31:33 +02:00
Marino Meneghel abf98ac8be Remove unused methods
MAILAND-1767
2021-06-14 17:31:33 +02:00
Marino Meneghel 0078229871 Remove "isTransient" flag from everywhere
Such flag was used to differentiate between messages that were coming
from "Search" (being the transient ones) and those that weren't.

This conditional being performed in many places was adding a lot of
noise and not really bringing any value, as the same behaviour can be
achieved by not storing messages from search in the first place.
2021-05-17 18:41:05 +02:00
Tomasz Giszczak 469669e3e7 Updated message read/unread logic settings, make as unread when message is decrypted, added more loging.
MAILAND-1868
2021-05-17 11:41:59 +02:00
Davide Farella 65ac54efd3 Move mapping to LabelChipUiModel to MessageDetailsViewModel.kt
MAILAND-1502
2021-05-13 17:20:52 +02:00
Davide Farella e317e6fea1 Enable LabelRepository.kt to get all labels per user
MAILAND-1502
2021-05-13 14:36:54 +00:00
Tomasz Giszczak 36beb44829 Moved some labels and message related logic for action sheet from MessageDetailsRepository to MessageRepository.
MAILAND-1401
2021-05-11 15:50:25 +02:00
Tomasz Giszczak f13f28310e Added MessageActionSheetViewModelTest and some minor refactor in action sheets.
MAILAND-1401
2021-05-11 15:50:25 +02:00
Tomasz Giszczak 001d21f92a Created MessageActionSheetViewModel renamed MessageDetailsActionSheet as MessageActionSheet for more generic usage.
MAILAND-1401
2021-05-11 15:50:25 +02:00
Tomasz Giszczak c77d3a12b3 Updated MoveMessagesToFolder use case to use messages repository and added some tests.
MAILAND-1401
2021-05-11 15:50:25 +02:00
Tomasz Giszczak 2cfc2e511d RecyclerView added to Labels action sheet.
MAILAND-1401
2021-05-11 15:50:24 +02:00
Zorica Stojchevska 6a895bcc97 cleanup after conflicts, as part of cherry picking regression fixes for 766 2021-04-06 10:56:27 +02:00
Marino Meneghel b0569d75fb Cleanup old constant feature flags and their usages
MAILAND-1436
2021-04-01 07:10:28 +00:00
Davide Farella cd4692b40d Fix tests after rebase
MAILAND-1189
2021-03-19 16:17:35 +01:00
Davide Farella cadea38abf Fix crash during logout
MAILAND-1603
2021-03-18 10:48:26 +01:00
Davide Farella bf687b64dc Extract AppUtil.deleteDatabases in ClearUserData.kt use case
MAILAND-1603

# Conflicts:
#	app/src/main/java/ch/protonmail/android/jobs/messages/PostMessageJob.java

# Conflicts:
#	app/src/main/java/ch/protonmail/android/fcm/FcmIntentService.java
2021-03-18 10:48:24 +01:00
Davide Farella 312683c0b1 Fix Message Database issue after rebase
MAILAND-1189

# Conflicts:
#	app/src/main/java/ch/protonmail/android/data/local/MessageDao.kt
#	app/src/main/java/ch/protonmail/android/di/ApplicationModule.kt
2021-03-18 10:48:14 +01:00