parent
90e310b24e
commit
2e8a84c428
|
@ -26,9 +26,9 @@ import androidx.work.WorkInfo
|
|||
import androidx.work.WorkManager
|
||||
import ch.protonmail.android.adapters.LabelsAdapter
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType.MESSAGE_LABEL
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType.MESSAGE_LABEL
|
||||
import io.mockk.MockKAnnotations
|
||||
import io.mockk.every
|
||||
import io.mockk.impl.annotations.MockK
|
||||
|
|
|
@ -28,7 +28,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
|
|||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isGone
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isVisible
|
||||
|
|
|
@ -29,7 +29,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
|
|||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isGone
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isVisible
|
||||
import ch.protonmail.android.testAndroidInstrumented.matcher.withDrawable
|
||||
|
|
|
@ -25,7 +25,7 @@ import androidx.test.espresso.Espresso.onView
|
|||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isGone
|
||||
import ch.protonmail.android.testAndroidInstrumented.assertion.isVisible
|
||||
|
|
|
@ -32,7 +32,7 @@ import androidx.paging.toLiveData
|
|||
import androidx.work.WorkInfo
|
||||
import androidx.work.WorkManager
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.mapper.LabelUiModelMapper
|
||||
import ch.protonmail.android.mapper.map
|
||||
import ch.protonmail.android.uiModel.LabelUiModel
|
||||
|
|
|
@ -55,7 +55,7 @@ import ch.protonmail.android.details.presentation.MessageDetailsListItem
|
|||
import ch.protonmail.android.details.presentation.mapper.MessageEncryptionUiModelMapper
|
||||
import ch.protonmail.android.details.presentation.model.ConversationUiModel
|
||||
import ch.protonmail.android.details.presentation.view.MessageDetailsActionsView
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.utils.redirectToChrome
|
||||
import ch.protonmail.android.utils.ui.ExpandableRecyclerAdapter
|
||||
|
|
|
@ -40,8 +40,8 @@ import ch.protonmail.android.data.local.model.PendingUpload
|
|||
import ch.protonmail.android.jobs.PostReadJob
|
||||
import ch.protonmail.android.jobs.PostUnreadJob
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.utils.MessageUtils
|
||||
import com.birbit.android.jobqueue.JobManager
|
||||
import com.squareup.inject.assisted.Assisted
|
||||
|
|
|
@ -61,9 +61,9 @@ import ch.protonmail.android.events.Status
|
|||
import ch.protonmail.android.jobs.ReportPhishingJob
|
||||
import ch.protonmail.android.jobs.helper.EmbeddedImage
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsReadStatus
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsStarredStatus
|
||||
|
|
|
@ -24,7 +24,7 @@ import androidx.recyclerview.widget.ListAdapter
|
|||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.data.local.model.PendingSend
|
||||
import ch.protonmail.android.data.local.model.PendingUpload
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.mailbox.presentation.model.MailboxUiItem
|
||||
import ch.protonmail.android.utils.ui.selection.SelectionModeEnum
|
||||
import ch.protonmail.android.views.messagesList.MailboxItemFooterView
|
||||
|
|
|
@ -32,8 +32,8 @@ import ch.protonmail.android.api.segments.device.DeviceApi
|
|||
import ch.protonmail.android.api.segments.device.DeviceApiSpec
|
||||
import ch.protonmail.android.api.segments.key.KeyApi
|
||||
import ch.protonmail.android.api.segments.key.KeyApiSpec
|
||||
import ch.protonmail.android.labels.data.api.LabelApi
|
||||
import ch.protonmail.android.labels.data.api.LabelApiSpec
|
||||
import ch.protonmail.android.labels.data.remote.LabelApi
|
||||
import ch.protonmail.android.labels.data.remote.LabelApiSpec
|
||||
import ch.protonmail.android.api.segments.message.MessageApi
|
||||
import ch.protonmail.android.api.segments.message.MessageApiSpec
|
||||
import ch.protonmail.android.api.segments.organization.OrganizationApi
|
||||
|
|
|
@ -63,10 +63,10 @@ import ch.protonmail.android.api.segments.settings.mail.MailSettingsApiSpec
|
|||
import ch.protonmail.android.data.local.model.Attachment
|
||||
import ch.protonmail.android.data.local.model.FullContactDetailsResponse
|
||||
import ch.protonmail.android.details.data.remote.model.ConversationResponse
|
||||
import ch.protonmail.android.labels.data.api.LabelApiSpec
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.LabelApiSpec
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import ch.protonmail.android.mailbox.data.remote.ConversationApiSpec
|
||||
import ch.protonmail.android.mailbox.data.remote.model.ConversationIdsRequestBody
|
||||
import ch.protonmail.android.mailbox.data.remote.model.ConversationsActionResponses
|
||||
|
|
|
@ -28,7 +28,7 @@ import ch.protonmail.android.api.segments.organization.OrganizationService
|
|||
import ch.protonmail.android.api.segments.payment.PaymentService
|
||||
import ch.protonmail.android.api.segments.report.ReportService
|
||||
import ch.protonmail.android.api.segments.settings.mail.MailSettingsService
|
||||
import ch.protonmail.android.labels.data.api.LabelService
|
||||
import ch.protonmail.android.labels.data.remote.LabelService
|
||||
import ch.protonmail.android.mailbox.data.remote.ConversationService
|
||||
import retrofit2.Retrofit
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ package ch.protonmail.android.api.models.messages.receive
|
|||
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@ import ch.protonmail.android.api.models.ContactEmailsResponseV2
|
|||
import ch.protonmail.android.api.models.DatabaseProvider
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.first
|
||||
import me.proton.core.accountmanager.domain.AccountManager
|
||||
|
@ -68,7 +68,7 @@ class ContactEmailsManager @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun mapToContactLabelsEntity(labels: List<Label>?, userId: UserId): List<LabelEntity> {
|
||||
private fun mapToContactLabelsEntity(labels: List<LabelApiModel>?, userId: UserId): List<LabelEntity> {
|
||||
return labels?.map { label ->
|
||||
labelsMapper.mapLabelToLabelEntity(label, userId)
|
||||
} ?: emptyList()
|
||||
|
|
|
@ -42,11 +42,11 @@ import ch.protonmail.android.details.data.MessageFlagsToEncryptionMapper
|
|||
import ch.protonmail.android.event.data.remote.model.EventResponse
|
||||
import ch.protonmail.android.event.domain.model.ActionType
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.mailbox.data.local.UnreadCounterDao
|
||||
import ch.protonmail.android.mailbox.data.local.model.UnreadCounterEntity.Type
|
||||
import ch.protonmail.android.mailbox.data.mapper.ApiToDatabaseUnreadCounterMapper
|
||||
|
@ -544,7 +544,7 @@ internal class EventHandler @AssistedInject constructor(
|
|||
val item = event.label
|
||||
when (ActionType.fromInt(event.type)) {
|
||||
ActionType.CREATE -> {
|
||||
val labelType = item.type!!
|
||||
val labelType = item.type
|
||||
val id = item.id
|
||||
val name = item.name
|
||||
val color = item.color
|
||||
|
@ -627,7 +627,7 @@ internal class EventHandler @AssistedInject constructor(
|
|||
|
||||
private fun writeMessageLabel(
|
||||
currentLabel: LabelEntity?,
|
||||
updatedLabel: Label
|
||||
updatedLabel: LabelApiModel
|
||||
) {
|
||||
if (currentLabel != null) {
|
||||
val labelFactory = LabelsMapper()
|
||||
|
@ -640,7 +640,7 @@ internal class EventHandler @AssistedInject constructor(
|
|||
|
||||
private fun writeContactGroup(
|
||||
currentGroup: LabelEntity?,
|
||||
updatedGroup: Label
|
||||
updatedGroup: LabelApiModel
|
||||
) {
|
||||
if (currentGroup != null) {
|
||||
val contactLabelFactory = LabelsMapper()
|
||||
|
|
|
@ -39,7 +39,7 @@ import ch.protonmail.android.jobs.PostReadJob
|
|||
import ch.protonmail.android.jobs.ResignContactJob
|
||||
import ch.protonmail.android.jobs.contacts.GetSendPreferenceJob
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.utils.resettableLazy
|
||||
import ch.protonmail.android.utils.resettableManager
|
||||
import com.birbit.android.jobqueue.JobManager
|
||||
|
|
|
@ -28,7 +28,7 @@ import ch.protonmail.android.contacts.ErrorEnum
|
|||
import ch.protonmail.android.contacts.ErrorResponse
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.utils.Event
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
|
|
|
@ -37,7 +37,7 @@ import ch.protonmail.android.data.local.model.ContactEmail
|
|||
import ch.protonmail.android.domain.usecase.DownloadFile
|
||||
import ch.protonmail.android.exceptions.BadImageUrlException
|
||||
import ch.protonmail.android.exceptions.ImageNotFoundException
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.utils.Event
|
||||
import ch.protonmail.android.viewmodel.BaseViewModel
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package ch.protonmail.android.contacts.details
|
||||
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
|
||||
data class ContactEmailsGroups(
|
||||
val groups: List<LabelEntity>,
|
||||
|
|
|
@ -26,9 +26,9 @@ import ch.protonmail.android.data.local.model.ContactData
|
|||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.data.local.model.FullContactDetails
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import com.birbit.android.jobqueue.JobManager
|
||||
import io.reactivex.Observable
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
|
|
@ -21,7 +21,7 @@ package ch.protonmail.android.contacts.details.domain
|
|||
|
||||
import ch.protonmail.android.contacts.details.data.ContactDetailsRepository
|
||||
import ch.protonmail.android.contacts.details.domain.model.FetchContactGroupsResult
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package ch.protonmail.android.contacts.details.domain.model
|
||||
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
|
||||
data class FetchContactGroupsResult(
|
||||
val groupsList: List<LabelEntity>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package ch.protonmail.android.contacts.details.presentation.model
|
||||
|
||||
import androidx.annotation.ColorInt
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
|
||||
sealed class ContactDetailsUiItem {
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package ch.protonmail.android.contacts.details.presentation.model
|
||||
|
||||
import ch.protonmail.android.contacts.details.ContactEmailGroupSelectionState
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
|
||||
data class ContactLabelUiModel(
|
||||
val id: LabelId,
|
||||
|
|
|
@ -21,8 +21,8 @@ package ch.protonmail.android.contacts.groups.details
|
|||
import ch.protonmail.android.data.ContactsRepository
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -31,9 +31,6 @@ class ContactGroupDetailsRepository @Inject constructor(
|
|||
private val contactRepository: ContactsRepository
|
||||
) {
|
||||
|
||||
suspend fun findContactGroupDetails(id: String): LabelEntity? =
|
||||
labelRepository.findLabel(LabelId(id))
|
||||
|
||||
fun observeContactGroupDetails(id: String): Flow<LabelEntity?> =
|
||||
labelRepository.observeLabel(LabelId(id))
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import ch.protonmail.android.contacts.groups.list.ContactGroupListItem
|
|||
import ch.protonmail.android.contacts.list.viewModel.ContactsListMapper
|
||||
import ch.protonmail.android.data.ContactsRepository
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.usecase.delete.DeleteLabel
|
||||
import ch.protonmail.android.utils.Event
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
|
|
|
@ -25,9 +25,9 @@ import ch.protonmail.android.contacts.groups.jobs.SetMembersForContactGroupJob
|
|||
import ch.protonmail.android.data.ContactsRepository
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.worker.CreateContactGroupWorker
|
||||
import ch.protonmail.android.worker.RemoveMembersFromContactGroupWorker
|
||||
import com.birbit.android.jobqueue.JobManager
|
||||
|
|
|
@ -31,9 +31,9 @@ import ch.protonmail.android.contacts.PostResult
|
|||
import ch.protonmail.android.contacts.groups.list.ContactGroupListItem
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.events.Status
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.utils.Event
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
|
|
|
@ -23,7 +23,7 @@ import ch.protonmail.android.data.ContactsRepository
|
|||
import ch.protonmail.android.data.local.ContactDao
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
|
|
|
@ -26,7 +26,7 @@ import ch.protonmail.android.contacts.groups.list.ContactGroupListItem
|
|||
import ch.protonmail.android.contacts.list.listView.ContactItem
|
||||
import ch.protonmail.android.data.local.model.ContactData
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.utils.UiUtil
|
||||
import me.proton.core.util.kotlin.EMPTY_STRING
|
||||
import java.util.Locale
|
||||
|
|
|
@ -26,8 +26,8 @@ import androidx.room.Room
|
|||
import androidx.room.TypeConverters
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import ch.protonmail.android.labels.data.db.LabelDao
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.LabelDao
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import me.proton.core.account.data.db.AccountConverters
|
||||
import me.proton.core.account.data.db.AccountDatabase
|
||||
import me.proton.core.account.data.entity.AccountEntity
|
||||
|
|
|
@ -22,8 +22,8 @@ import ch.protonmail.android.api.models.DatabaseProvider
|
|||
import ch.protonmail.android.core.UserManager
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.filterNotNull
|
||||
import kotlinx.coroutines.flow.first
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package ch.protonmail.android.data
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
|
||||
/**
|
||||
* DB converters specific to Proton Mail app.
|
||||
|
|
|
@ -45,8 +45,8 @@ import ch.protonmail.android.crypto.Crypto
|
|||
import ch.protonmail.android.data.local.MessageDao
|
||||
import ch.protonmail.android.domain.util.checkNotBlank
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.utils.MessageUtils
|
||||
import ch.protonmail.android.utils.UiUtil
|
||||
import ch.protonmail.android.utils.crypto.KeyInformation
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package ch.protonmail.android.details.presentation.model
|
||||
|
||||
import ch.protonmail.android.data.local.model.Message
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
|
||||
data class ConversationUiModel(
|
||||
|
|
|
@ -32,7 +32,7 @@ import ch.protonmail.android.data.local.MessageDao
|
|||
import ch.protonmail.android.data.local.MessageDatabase
|
||||
import ch.protonmail.android.data.local.PendingActionDao
|
||||
import ch.protonmail.android.data.local.PendingActionDatabase
|
||||
import ch.protonmail.android.labels.data.db.LabelDao
|
||||
import ch.protonmail.android.labels.data.local.LabelDao
|
||||
import ch.protonmail.android.mailbox.data.local.ConversationDao
|
||||
import ch.protonmail.android.mailbox.data.local.UnreadCounterDao
|
||||
import dagger.Module
|
||||
|
|
|
@ -23,8 +23,8 @@ import android.graphics.Color
|
|||
import androidx.annotation.VisibleForTesting
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.drawer.presentation.model.DrawerLabelUiModel
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.mapper.UiModelMapper
|
||||
import ch.protonmail.android.utils.UiUtil
|
||||
import timber.log.Timber
|
||||
|
|
|
@ -28,13 +28,13 @@ import ch.protonmail.android.api.models.MailSettings;
|
|||
import ch.protonmail.android.api.models.ResponseBody;
|
||||
import ch.protonmail.android.api.models.User;
|
||||
import ch.protonmail.android.api.models.address.Address;
|
||||
import ch.protonmail.android.labels.data.model.Label;
|
||||
import ch.protonmail.android.api.models.messages.receive.ServerMessage;
|
||||
import ch.protonmail.android.api.utils.Fields;
|
||||
import ch.protonmail.android.data.local.model.ContactEmail;
|
||||
import ch.protonmail.android.data.local.model.FullContactDetails;
|
||||
import ch.protonmail.android.data.local.model.FullContactDetailsFactory;
|
||||
import ch.protonmail.android.data.local.model.ServerFullContactDetails;
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel;
|
||||
import ch.protonmail.android.mailbox.data.remote.model.CountsApiModel;
|
||||
|
||||
public class EventResponse extends ResponseBody {
|
||||
|
@ -90,9 +90,13 @@ public class EventResponse extends ResponseBody {
|
|||
return conversations;
|
||||
}
|
||||
|
||||
public List<ContactEventBody> getContactUpdates() { return contacts; }
|
||||
public List<ContactEventBody> getContactUpdates() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public List<ContactEmailEventBody> getContactEmailsUpdates() { return contactEmails; }
|
||||
public List<ContactEmailEventBody> getContactEmailsUpdates() {
|
||||
return contactEmails;
|
||||
}
|
||||
|
||||
public List<CountsApiModel> getMessageCounts() {
|
||||
return messageCounts;
|
||||
|
@ -102,13 +106,21 @@ public class EventResponse extends ResponseBody {
|
|||
return conversationCounts;
|
||||
}
|
||||
|
||||
public List<LabelsEventBody> getLabelUpdates() { return labels; }
|
||||
public List<LabelsEventBody> getLabelUpdates() {
|
||||
return labels;
|
||||
}
|
||||
|
||||
public User getUserUpdates(){ return user; }
|
||||
public User getUserUpdates() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public MailSettings getMailSettingsUpdates(){ return mailSettings; }
|
||||
public MailSettings getMailSettingsUpdates() {
|
||||
return mailSettings;
|
||||
}
|
||||
|
||||
public String getEventID(){ return eventID;}
|
||||
public String getEventID() {
|
||||
return eventID;
|
||||
}
|
||||
|
||||
public boolean refreshContacts() {
|
||||
return (refresh & RefreshStatus.CONTACTS.getStatus()) == RefreshStatus.CONTACTS.getStatus();
|
||||
|
@ -117,7 +129,7 @@ public class EventResponse extends ResponseBody {
|
|||
public boolean refresh() {
|
||||
return
|
||||
(refresh & RefreshStatus.MAIL.getStatus()) == RefreshStatus.MAIL.getStatus() ||
|
||||
(refresh & RefreshStatus.ALL.getStatus()) == RefreshStatus.ALL.getStatus();
|
||||
(refresh & RefreshStatus.ALL.getStatus()) == RefreshStatus.ALL.getStatus();
|
||||
}
|
||||
|
||||
public long getUsedSpace() {
|
||||
|
@ -187,7 +199,7 @@ public class EventResponse extends ResponseBody {
|
|||
}
|
||||
|
||||
public FullContactDetails getContact() {
|
||||
FullContactDetailsFactory fullContactDetailsFactory=new FullContactDetailsFactory();
|
||||
FullContactDetailsFactory fullContactDetailsFactory = new FullContactDetailsFactory();
|
||||
return fullContactDetailsFactory.createFullContactDetails(contact);
|
||||
}
|
||||
|
||||
|
@ -223,7 +235,7 @@ public class EventResponse extends ResponseBody {
|
|||
@SerializedName(Fields.Events.ACTION)
|
||||
private int action;
|
||||
@SerializedName(Fields.Events.LABEL)
|
||||
private Label label;
|
||||
private LabelApiModel label;
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
|
@ -233,7 +245,7 @@ public class EventResponse extends ResponseBody {
|
|||
return action;
|
||||
}
|
||||
|
||||
public Label getLabel() {
|
||||
public LabelApiModel getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,9 @@ import ch.protonmail.android.data.local.model.ContactData
|
|||
import ch.protonmail.android.events.ContactEvent
|
||||
import ch.protonmail.android.events.ContactProgressEvent
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.utils.AppUtil
|
||||
import ch.protonmail.android.views.models.LocalContact
|
||||
import ch.protonmail.android.views.models.LocalContactAddress
|
||||
|
|
|
@ -35,9 +35,9 @@ import ch.protonmail.android.data.local.MessageDatabase;
|
|||
import ch.protonmail.android.data.local.model.Message;
|
||||
import ch.protonmail.android.data.local.model.UnreadLocationCounter;
|
||||
import ch.protonmail.android.labels.data.LabelRepository;
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.model.LabelType;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class MoveToFolderJob extends ProtonMailBaseJob {
|
||||
|
|
|
@ -33,9 +33,9 @@ import ch.protonmail.android.data.local.CounterDatabase;
|
|||
import ch.protonmail.android.data.local.model.Message;
|
||||
import ch.protonmail.android.data.local.model.UnreadLocationCounter;
|
||||
import ch.protonmail.android.labels.data.LabelRepository;
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.model.LabelType;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class PostInboxJob extends ProtonMailCounterJob {
|
||||
|
|
|
@ -33,9 +33,9 @@ import ch.protonmail.android.data.local.CounterDatabase;
|
|||
import ch.protonmail.android.data.local.model.Message;
|
||||
import ch.protonmail.android.data.local.model.UnreadLocationCounter;
|
||||
import ch.protonmail.android.labels.data.LabelRepository;
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.model.LabelType;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId;
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class PostTrashJobV2 extends ProtonMailCounterJob {
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package ch.protonmail.android.labels.data
|
||||
|
||||
import androidx.paging.DataSource
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import me.proton.core.domain.entity.UserId
|
||||
|
||||
|
|
|
@ -22,11 +22,11 @@ package ch.protonmail.android.labels.data
|
|||
import androidx.paging.DataSource
|
||||
import ch.protonmail.android.api.ProtonMailApi
|
||||
import ch.protonmail.android.core.NetworkConnectivityManager
|
||||
import ch.protonmail.android.labels.data.db.LabelDao
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.LabelDao
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
|
|
@ -17,16 +17,23 @@
|
|||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
package ch.protonmail.android.labels.data.db
|
||||
package ch.protonmail.android.labels.data.local
|
||||
|
||||
import androidx.paging.DataSource
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Query
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_FOLDER
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_MESSAGE_LABEL
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.COLUMN_LABEL_ID
|
||||
import ch.protonmail.android.labels.data.local.model.COLUMN_LABEL_NAME
|
||||
import ch.protonmail.android.labels.data.local.model.COLUMN_LABEL_ORDER
|
||||
import ch.protonmail.android.labels.data.local.model.COLUMN_LABEL_TYPE
|
||||
import ch.protonmail.android.labels.data.local.model.COLUMN_LABEL_USER_ID
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_FOLDER
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_MESSAGE_LABEL
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.TABLE_LABELS
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import me.proton.core.data.room.db.BaseDao
|
||||
import me.proton.core.domain.entity.UserId
|
|
@ -16,14 +16,12 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.db
|
||||
package ch.protonmail.android.labels.data.local.model
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.ForeignKey
|
||||
import androidx.room.Index
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import me.proton.core.domain.entity.UserId
|
||||
import me.proton.core.user.data.entity.UserEntity
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.local.model
|
||||
|
||||
/**
|
||||
* Entity representing a LabelId.
|
|
@ -17,7 +17,7 @@
|
|||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.local.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
|
@ -19,17 +19,17 @@
|
|||
package ch.protonmail.android.labels.data.mapper
|
||||
|
||||
import ch.protonmail.android.contacts.details.presentation.model.ContactLabelUiModel
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import me.proton.core.domain.entity.UserId
|
||||
import me.proton.core.util.kotlin.EMPTY_STRING
|
||||
import javax.inject.Inject
|
||||
|
||||
class LabelsMapper @Inject constructor() {
|
||||
|
||||
fun mapLabelToLabelEntity(serverLabel: Label, userId: UserId) = LabelEntity(
|
||||
fun mapLabelToLabelEntity(serverLabel: LabelApiModel, userId: UserId) = LabelEntity(
|
||||
id = LabelId(serverLabel.id),
|
||||
userId = userId,
|
||||
name = serverLabel.name,
|
||||
|
@ -43,7 +43,7 @@ class LabelsMapper @Inject constructor() {
|
|||
notify = serverLabel.notify
|
||||
)
|
||||
|
||||
fun mapLabelEntityToServerLabel(labelEntity: LabelEntity) = Label(
|
||||
fun mapLabelEntityToServerLabel(labelEntity: LabelEntity) = LabelApiModel(
|
||||
id = labelEntity.id.id,
|
||||
name = labelEntity.name,
|
||||
path = labelEntity.path,
|
||||
|
@ -66,7 +66,7 @@ class LabelsMapper @Inject constructor() {
|
|||
sticky = null
|
||||
)
|
||||
|
||||
fun mapLabelToContactLabelUiModel(serverLabel: Label, contactEmailsCount: Int) = ContactLabelUiModel(
|
||||
fun mapLabelToContactLabelUiModel(serverLabel: LabelApiModel, contactEmailsCount: Int) = ContactLabelUiModel(
|
||||
id = LabelId(serverLabel.id),
|
||||
name = serverLabel.name,
|
||||
color = serverLabel.color,
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.api
|
||||
package ch.protonmail.android.labels.data.remote
|
||||
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import me.proton.core.domain.entity.UserId
|
||||
import me.proton.core.network.data.ApiProvider
|
||||
import me.proton.core.network.domain.ApiResult
|
|
@ -16,11 +16,11 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.api
|
||||
package ch.protonmail.android.labels.data.remote
|
||||
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import me.proton.core.domain.entity.UserId
|
||||
import me.proton.core.network.domain.ApiResult
|
||||
|
|
@ -16,16 +16,16 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.api
|
||||
package ch.protonmail.android.labels.data.remote
|
||||
|
||||
import ch.protonmail.android.api.segments.RetrofitConstants.ACCEPT_HEADER_V1
|
||||
import ch.protonmail.android.api.segments.RetrofitConstants.CONTENT_TYPE
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_FOLDER
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_MESSAGE_LABEL
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_FOLDER
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_MESSAGE_LABEL
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import me.proton.core.network.data.protonApi.BaseRetrofitApi
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.DELETE
|
|
@ -17,8 +17,9 @@
|
|||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.remote.model
|
||||
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
|
@ -34,7 +35,7 @@ internal const val STICKY = "Sticky"
|
|||
internal const val PARENT_ID = "ParentID"
|
||||
|
||||
@Serializable
|
||||
data class Label(
|
||||
data class LabelApiModel(
|
||||
@SerialName(ID)
|
||||
val id: String,
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.remote.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
|
@ -16,7 +16,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.remote.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -26,5 +26,5 @@ private const val FIELD_LABEL = "Label"
|
|||
@Serializable
|
||||
data class LabelResponse(
|
||||
@SerialName(FIELD_LABEL)
|
||||
val label: Label
|
||||
val label: LabelApiModel
|
||||
)
|
|
@ -16,7 +16,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonMail. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
package ch.protonmail.android.labels.data.model
|
||||
package ch.protonmail.android.labels.data.remote.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
@ -26,5 +26,5 @@ private const val FIELD_LABELS = "Labels"
|
|||
@Serializable
|
||||
data class LabelsResponse(
|
||||
@SerialName(FIELD_LABELS)
|
||||
val labels: List<Label>
|
||||
val labels: List<LabelApiModel>
|
||||
)
|
|
@ -21,7 +21,7 @@ package ch.protonmail.android.labels.domain.usecase
|
|||
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.mapper.LabelActionItemUiModelMapper
|
||||
import ch.protonmail.android.labels.presentation.model.LabelActonItemUiModel
|
||||
import ch.protonmail.android.labels.presentation.model.StandardFolderLocation
|
||||
|
|
|
@ -21,8 +21,8 @@ package ch.protonmail.android.labels.domain.usecase
|
|||
|
||||
import ch.protonmail.android.data.local.model.Message
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.repository.MessageRepository
|
||||
import ch.protonmail.android.worker.ApplyLabelWorker
|
||||
import ch.protonmail.android.worker.RemoveLabelWorker
|
||||
|
|
|
@ -22,8 +22,8 @@ package ch.protonmail.android.labels.presentation.mapper
|
|||
import android.content.Context
|
||||
import androidx.core.graphics.toColorInt
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.model.LabelActonItemUiModel
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
|
|
@ -20,8 +20,8 @@ package ch.protonmail.android.labels.presentation.mapper
|
|||
|
||||
import android.graphics.Color
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.mapper.UiModelMapper
|
||||
import ch.protonmail.android.uiModel.LabelUiModel
|
||||
import ch.protonmail.android.utils.UiUtil
|
||||
|
|
|
@ -23,7 +23,7 @@ import android.graphics.Color
|
|||
import androidx.annotation.ColorInt
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
|
||||
data class LabelActonItemUiModel(
|
||||
val labelId: String,
|
||||
|
|
|
@ -32,7 +32,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.databinding.FragmentLabelsActionSheetBinding
|
||||
import ch.protonmail.android.details.presentation.MessageDetailsActivity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.model.ManageLabelActionResult
|
||||
import ch.protonmail.android.labels.presentation.model.LabelActonItemUiModel
|
||||
import ch.protonmail.android.labels.presentation.viewmodel.LabelsActionAdapter
|
||||
|
|
|
@ -27,7 +27,7 @@ import ch.protonmail.android.core.Constants.MessageLocationType.ARCHIVE
|
|||
import ch.protonmail.android.core.Constants.MessageLocationType.INVALID
|
||||
import ch.protonmail.android.core.Constants.MessageLocationType.TRASH
|
||||
import ch.protonmail.android.core.UserManager
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.model.ManageLabelActionResult
|
||||
import ch.protonmail.android.labels.domain.usecase.GetAllLabels
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
|
|
|
@ -29,8 +29,8 @@ import ch.protonmail.android.details.data.remote.model.ConversationResponse
|
|||
import ch.protonmail.android.details.data.toDomainModelList
|
||||
import ch.protonmail.android.domain.LoadMoreFlow
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.mailbox.data.local.ConversationDao
|
||||
import ch.protonmail.android.mailbox.data.local.UnreadCounterDao
|
||||
import ch.protonmail.android.mailbox.data.local.model.ConversationDatabaseModel
|
||||
|
|
|
@ -103,8 +103,8 @@ import ch.protonmail.android.fcm.model.FirebaseToken
|
|||
import ch.protonmail.android.feature.account.AccountStateManager
|
||||
import ch.protonmail.android.jobs.EmptyFolderJob
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.ui.LabelsActionSheet
|
||||
import ch.protonmail.android.mailbox.presentation.MailboxViewModel.MaxLabelsReached
|
||||
import ch.protonmail.android.mailbox.presentation.model.MailboxUiItem
|
||||
|
|
|
@ -41,9 +41,9 @@ import ch.protonmail.android.jobs.ApplyLabelJob
|
|||
import ch.protonmail.android.jobs.PostStarJob
|
||||
import ch.protonmail.android.jobs.RemoveLabelJob
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.labels.domain.usecase.ObserveLabels
|
||||
import ch.protonmail.android.mailbox.data.mapper.MessageRecipientToCorrespondentMapper
|
||||
|
|
|
@ -38,7 +38,7 @@ import ch.protonmail.android.core.Constants
|
|||
import ch.protonmail.android.databinding.FragmentMessageActionSheetBinding
|
||||
import ch.protonmail.android.databinding.LayoutMessageDetailsActionsSheetButtonsBinding
|
||||
import ch.protonmail.android.details.presentation.MessageDetailsActivity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.ui.LabelsActionSheet
|
||||
import ch.protonmail.android.ui.actionsheet.model.ActionSheetTarget
|
||||
import ch.protonmail.android.utils.AppUtil
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package ch.protonmail.android.ui.actionsheet
|
||||
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.ui.actionsheet.model.ActionSheetTarget
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.SavedStateHandle
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsReadStatus
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsStarredStatus
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package ch.protonmail.android.ui.model
|
||||
|
||||
import androidx.annotation.ColorInt
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
|
||||
/**
|
||||
* Ui Model for [LabelChipView]
|
||||
|
|
|
@ -28,7 +28,7 @@ import androidx.appcompat.content.res.AppCompatResources
|
|||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.core.content.withStyledAttributes
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.utils.extensions.fromAttributesOrPreviewOrNull
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import androidx.annotation.ColorInt
|
|||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.core.content.withStyledAttributes
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.utils.extensions.fromAttributesOrPreviewOrNull
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
|
|
|
@ -29,7 +29,7 @@ import androidx.core.view.isVisible
|
|||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.utils.extensions.isInPreviewMode
|
||||
|
|
|
@ -27,7 +27,7 @@ import android.widget.FrameLayout
|
|||
import androidx.annotation.StyleRes
|
||||
import androidx.core.view.isVisible
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.ui.layout.MoreItemsLinearLayout
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.utils.extensions.isInPreviewMode
|
||||
|
|
|
@ -27,7 +27,7 @@ import android.widget.FrameLayout
|
|||
import androidx.annotation.StyleRes
|
||||
import androidx.core.view.isVisible
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.ui.layout.MoreItemsLinearLayout
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
|
|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.LiveData
|
|||
import androidx.lifecycle.map
|
||||
import androidx.work.WorkInfo
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.utils.extensions.filter
|
||||
import ch.protonmail.android.worker.DeleteLabelWorker
|
||||
import kotlinx.coroutines.ensureActive
|
||||
|
|
|
@ -45,7 +45,7 @@ import ch.protonmail.android.details.presentation.MessageDetailsActivity
|
|||
import ch.protonmail.android.details.presentation.model.MessageEncryptionUiModel
|
||||
import ch.protonmail.android.details.presentation.view.CollapsedMessageViews
|
||||
import ch.protonmail.android.details.presentation.view.MessageDetailsHeaderIcons
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.ui.model.LabelChipUiModel
|
||||
import ch.protonmail.android.ui.view.MultiLineLabelChipGroupView
|
||||
import ch.protonmail.android.ui.view.SingleLineLabelChipGroupView
|
||||
|
|
|
@ -30,10 +30,10 @@ import androidx.work.WorkerParameters
|
|||
import androidx.work.workDataOf
|
||||
import ch.protonmail.android.api.ProtonMailApiManager
|
||||
import ch.protonmail.android.contacts.groups.list.ContactGroupsRepository
|
||||
import ch.protonmail.android.labels.data.local.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LABEL_TYPE_ID_CONTACT_GROUP
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.flow.first
|
||||
|
|
|
@ -30,10 +30,10 @@ import androidx.work.WorkerParameters
|
|||
import androidx.work.workDataOf
|
||||
import ch.protonmail.android.api.ProtonMailApiManager
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import kotlinx.coroutines.flow.first
|
||||
|
|
|
@ -45,9 +45,9 @@ import ch.protonmail.android.domain.entity.Name
|
|||
import ch.protonmail.android.domain.loadMoreFlowOf
|
||||
import ch.protonmail.android.domain.withLoadMore
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.mailbox.data.mapper.MessageRecipientToCorrespondentMapper
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsReadStatus
|
||||
|
@ -1059,8 +1059,14 @@ class MailboxViewModelTest : ArchTest, CoroutinesTest {
|
|||
listOf(LabelId(ALL_DRAFT_LABEL_ID), LabelId(DRAFT_LABEL_ID))
|
||||
)
|
||||
} returns listOf(
|
||||
LabelEntity(LabelId(ALL_DRAFT_LABEL_ID), currentUserId, "label 1", "blue", 0, LabelType.MESSAGE_LABEL, "", "", 0, 0, 0),
|
||||
LabelEntity(LabelId(DRAFT_LABEL_ID), currentUserId, "label 8", "blue", 0, LabelType.MESSAGE_LABEL, "", "", 0, 0, 0)
|
||||
LabelEntity(
|
||||
LabelId(ALL_DRAFT_LABEL_ID), currentUserId, "label 1", "blue", 0, LabelType.MESSAGE_LABEL, "", "",
|
||||
0, 0, 0
|
||||
),
|
||||
LabelEntity(
|
||||
LabelId(DRAFT_LABEL_ID), currentUserId, "label 8", "blue", 0, LabelType.MESSAGE_LABEL, "", "", 0, 0,
|
||||
0
|
||||
)
|
||||
)
|
||||
|
||||
// Then
|
||||
|
|
|
@ -44,9 +44,9 @@ import ch.protonmail.android.details.presentation.model.MessageBodyState
|
|||
import ch.protonmail.android.details.presentation.model.RenderedMessage
|
||||
import ch.protonmail.android.domain.entity.Name
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsReadStatus
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsStarredStatus
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
|
||||
package ch.protonmail.android.api.models.contacts.receive
|
||||
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import me.proton.core.domain.entity.UserId
|
||||
import org.junit.Assert.assertEquals
|
||||
import kotlin.test.BeforeTest
|
||||
|
@ -49,7 +49,7 @@ class LabelsMapperTest {
|
|||
|
||||
val actual = labelsMapper.mapLabelEntityToServerLabel(contactLabel)
|
||||
|
||||
val expected = Label(
|
||||
val expected = LabelApiModel(
|
||||
id = "ID",
|
||||
name = "name",
|
||||
color = "color",
|
||||
|
@ -70,7 +70,7 @@ class LabelsMapperTest {
|
|||
|
||||
val actual = labelsMapper.mapLabelEntityToServerLabel(contactLabel)
|
||||
|
||||
val expected = Label(
|
||||
val expected = LabelApiModel(
|
||||
id = "ID",
|
||||
name = "name",
|
||||
color = "color",
|
||||
|
@ -91,7 +91,7 @@ class LabelsMapperTest {
|
|||
|
||||
val actual = labelsMapper.mapLabelEntityToServerLabel(contactLabel)
|
||||
|
||||
val expected = Label(
|
||||
val expected = LabelApiModel(
|
||||
id = "",
|
||||
name = "name",
|
||||
color = "color",
|
||||
|
@ -108,7 +108,7 @@ class LabelsMapperTest {
|
|||
|
||||
@Test
|
||||
fun mappingServerLabelToLabelEntitySucceedsWhenAllFieldsAreValid() {
|
||||
val serverLabel = Label(
|
||||
val serverLabel = LabelApiModel(
|
||||
id = "ID",
|
||||
name = "name",
|
||||
color = "color",
|
||||
|
|
|
@ -21,9 +21,9 @@ package ch.protonmail.android.api.models.messages.receive
|
|||
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.mockk
|
||||
import org.junit.Test
|
||||
|
|
|
@ -26,12 +26,12 @@ import ch.protonmail.android.core.Constants
|
|||
import ch.protonmail.android.data.local.ContactDao
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import io.mockk.MockKAnnotations
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.coVerify
|
||||
|
@ -90,7 +90,7 @@ class ContactEmailsManagerTest : CoroutinesTest, ArchTest {
|
|||
val labelId1 = "labelId1"
|
||||
val labelName1 = "labelName1"
|
||||
val labelColor = "labelColor11"
|
||||
val label = Label(
|
||||
val label = LabelApiModel(
|
||||
id = labelId1,
|
||||
name = labelName1,
|
||||
path = testPath,
|
||||
|
@ -145,7 +145,7 @@ class ContactEmailsManagerTest : CoroutinesTest, ArchTest {
|
|||
val labelId1 = "labelId1"
|
||||
val labelName1 = "labelName1"
|
||||
val labelColor = "labelColor11"
|
||||
val label = Label(
|
||||
val label = LabelApiModel(
|
||||
id = labelId1,
|
||||
name = labelName1,
|
||||
path = "",
|
||||
|
|
|
@ -23,9 +23,9 @@ import ch.protonmail.android.contacts.groups.list.ContactGroupsRepository
|
|||
import ch.protonmail.android.data.ContactsRepository
|
||||
import ch.protonmail.android.data.local.ContactDao
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.testAndroid.rx.TestSchedulerRule
|
||||
import io.mockk.MockKAnnotations
|
||||
import io.mockk.Runs
|
||||
|
|
|
@ -22,9 +22,9 @@ package ch.protonmail.android.contacts.details.domain
|
|||
import ch.protonmail.android.contacts.details.data.ContactDetailsRepository
|
||||
import ch.protonmail.android.contacts.details.domain.model.FetchContactGroupsResult
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
|
|
|
@ -24,9 +24,9 @@ import ch.protonmail.android.contacts.details.domain.model.FetchContactDetailsRe
|
|||
import ch.protonmail.android.contacts.details.domain.model.FetchContactGroupsResult
|
||||
import ch.protonmail.android.contacts.details.presentation.model.ContactDetailsUiItem
|
||||
import ch.protonmail.android.contacts.details.presentation.model.ContactDetailsViewState
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import io.mockk.every
|
||||
import io.mockk.mockkStatic
|
||||
import io.mockk.unmockkStatic
|
||||
|
|
|
@ -31,9 +31,9 @@ import ch.protonmail.android.contacts.details.domain.model.FetchContactDetailsRe
|
|||
import ch.protonmail.android.contacts.details.domain.model.FetchContactGroupsResult
|
||||
import ch.protonmail.android.contacts.details.presentation.model.ContactDetailsUiItem
|
||||
import ch.protonmail.android.contacts.details.presentation.model.ContactDetailsViewState
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.utils.FileHelper
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.every
|
||||
|
|
|
@ -26,8 +26,8 @@ import ch.protonmail.android.contacts.groups.list.ContactGroupsRepository
|
|||
import ch.protonmail.android.contacts.groups.list.ContactGroupsViewModel
|
||||
import ch.protonmail.android.contacts.list.viewModel.ContactsListMapper
|
||||
import ch.protonmail.android.core.UserManager
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.testAndroid.lifecycle.testObserver
|
||||
import ch.protonmail.android.usecase.delete.DeleteLabel
|
||||
import ch.protonmail.android.utils.Event
|
||||
|
|
|
@ -24,13 +24,13 @@ import ch.protonmail.android.api.ProtonMailApiManager
|
|||
import ch.protonmail.android.data.ContactsRepository
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.model.LabelResponse
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelRequestBody
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelResponse
|
||||
import ch.protonmail.android.worker.CreateContactGroupWorker
|
||||
import com.birbit.android.jobqueue.JobManager
|
||||
import io.mockk.Runs
|
||||
|
@ -71,7 +71,7 @@ class ContactGroupEditCreateRepositoryTest {
|
|||
private val testParentId = "parentIdForTests"
|
||||
private val testType = LabelType.CONTACT_GROUP
|
||||
|
||||
private val testLabel = Label(
|
||||
private val testLabel = LabelApiModel(
|
||||
id = "labelID",
|
||||
name = "name",
|
||||
color = "color",
|
||||
|
|
|
@ -26,8 +26,8 @@ import ch.protonmail.android.contacts.groups.list.ContactGroupListItem
|
|||
import ch.protonmail.android.contacts.list.listView.ContactItem
|
||||
import ch.protonmail.android.data.local.model.ContactData
|
||||
import ch.protonmail.android.data.local.model.ContactEmail
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import io.mockk.every
|
||||
import io.mockk.mockkStatic
|
||||
import io.mockk.unmockkStatic
|
||||
|
|
|
@ -23,7 +23,7 @@ import android.graphics.Color
|
|||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.drawer.presentation.mapper.DrawerLabelUiModelMapper.Companion.AQUA_BASE_V3_COLOR
|
||||
import ch.protonmail.android.drawer.presentation.mapper.DrawerLabelUiModelMapper.Companion.SAGE_BASE_V3_COLOR
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.mockkStatic
|
||||
|
|
|
@ -22,13 +22,13 @@ package ch.protonmail.android.labels.data
|
|||
import app.cash.turbine.test
|
||||
import ch.protonmail.android.api.ProtonMailApi
|
||||
import ch.protonmail.android.core.NetworkConnectivityManager
|
||||
import ch.protonmail.android.labels.data.db.LabelDao
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.LabelDao
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.data.mapper.LabelsMapper
|
||||
import ch.protonmail.android.labels.data.model.Label
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.model.LabelsResponse
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelApiModel
|
||||
import ch.protonmail.android.labels.data.remote.model.LabelsResponse
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.coVerify
|
||||
import io.mockk.mockk
|
||||
|
@ -137,7 +137,7 @@ class LabelRepositoryImplTest : CoroutinesTest {
|
|||
private const val testParentId = "parentIdForTests"
|
||||
val testUserId = UserId("testUser")
|
||||
|
||||
val testLabel1 = Label(
|
||||
val testLabel1 = LabelApiModel(
|
||||
id = labelId1,
|
||||
name = labelName1,
|
||||
path = testPath,
|
||||
|
@ -149,7 +149,7 @@ class LabelRepositoryImplTest : CoroutinesTest {
|
|||
sticky = null,
|
||||
parentId = testParentId
|
||||
)
|
||||
val testLabel2 = Label(
|
||||
val testLabel2 = LabelApiModel(
|
||||
id = labelId2,
|
||||
name = labelName2,
|
||||
path = testPath,
|
||||
|
@ -161,7 +161,7 @@ class LabelRepositoryImplTest : CoroutinesTest {
|
|||
sticky = null,
|
||||
parentId = testParentId
|
||||
)
|
||||
val testLabel3 = Label(
|
||||
val testLabel3 = LabelApiModel(
|
||||
id = labelId3,
|
||||
name = labelName3,
|
||||
path = testPath,
|
||||
|
|
|
@ -22,9 +22,9 @@ package ch.protonmail.android.labels.domain.usecase
|
|||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.mapper.LabelActionItemUiModelMapper
|
||||
import ch.protonmail.android.labels.presentation.model.LabelActonItemUiModel
|
||||
import ch.protonmail.android.labels.presentation.model.StandardFolderLocation
|
||||
|
|
|
@ -21,9 +21,9 @@ package ch.protonmail.android.labels.domain.usecase
|
|||
|
||||
import ch.protonmail.android.data.local.model.Message
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.repository.MessageRepository
|
||||
import ch.protonmail.android.worker.ApplyLabelWorker
|
||||
import ch.protonmail.android.worker.RemoveLabelWorker
|
||||
|
|
|
@ -22,9 +22,9 @@ package ch.protonmail.android.labels.presentation.mapper
|
|||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import ch.protonmail.android.R
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.presentation.model.LabelActonItemUiModel
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
|
|
|
@ -25,7 +25,7 @@ import ch.protonmail.android.R
|
|||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.core.UserManager
|
||||
import ch.protonmail.android.data.local.model.Message
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.model.ManageLabelActionResult
|
||||
import ch.protonmail.android.labels.domain.usecase.GetAllLabels
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
|
|
|
@ -31,8 +31,8 @@ import ch.protonmail.android.data.local.model.Message
|
|||
import ch.protonmail.android.data.local.model.MessageSender
|
||||
import ch.protonmail.android.details.data.remote.model.ConversationResponse
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.mailbox.data.local.ConversationDao
|
||||
import ch.protonmail.android.mailbox.data.local.UnreadCounterDao
|
||||
import ch.protonmail.android.mailbox.data.local.model.ConversationDatabaseModel
|
||||
|
|
|
@ -22,7 +22,7 @@ package ch.protonmail.android.ui.dialog
|
|||
import androidx.lifecycle.SavedStateHandle
|
||||
import ch.protonmail.android.core.Constants
|
||||
import ch.protonmail.android.data.local.model.Message
|
||||
import ch.protonmail.android.labels.data.model.LabelType
|
||||
import ch.protonmail.android.labels.data.local.model.LabelType
|
||||
import ch.protonmail.android.labels.domain.usecase.MoveMessagesToFolder
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsReadStatus
|
||||
import ch.protonmail.android.mailbox.domain.ChangeConversationsStarredStatus
|
||||
|
|
|
@ -25,8 +25,8 @@ import androidx.work.WorkInfo
|
|||
import androidx.work.workDataOf
|
||||
import ch.protonmail.android.data.local.ContactDao
|
||||
import ch.protonmail.android.labels.data.LabelRepository
|
||||
import ch.protonmail.android.labels.data.db.LabelEntity
|
||||
import ch.protonmail.android.labels.data.model.LabelId
|
||||
import ch.protonmail.android.labels.data.local.model.LabelEntity
|
||||
import ch.protonmail.android.labels.data.local.model.LabelId
|
||||
import ch.protonmail.android.worker.DeleteLabelWorker
|
||||
import io.mockk.MockKAnnotations
|
||||
import io.mockk.coEvery
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue