@@ -19,30 +19,38 @@ package com.wire.kalium.logic.data.message
19
19
20
20
import com.wire.kalium.logic.data.id.ConversationId
21
21
import com.wire.kalium.util.serialization.toJsonElement
22
+ import kotlinx.serialization.Serializable
22
23
import kotlin.time.Duration
23
24
import kotlin.time.Duration.Companion.ZERO
24
25
26
+ @Serializable
25
27
sealed interface SelfDeletionTimer {
26
28
val duration: Duration ?
27
29
28
30
/* *
29
31
* Represents a self deletion timer that is currently disabled
30
32
*/
33
+ @Serializable
31
34
data object Disabled : SelfDeletionTimer {
32
35
override val duration: Duration ? = null
33
36
}
34
37
35
38
/* *
36
39
* Represents a self deletion timer that is enabled and can be changed/updated by the user
37
40
*/
41
+ @Serializable
38
42
data class Enabled (override val duration : Duration ? ) : SelfDeletionTimer
39
43
40
44
/* *
41
45
* Represents a self deletion timer that is imposed by the team or conversation settings that can't be changed by the user
42
- * @param enforcedDuration the team or conversation imposed timer
43
46
*/
47
+ @Serializable
44
48
sealed interface Enforced : SelfDeletionTimer {
49
+
50
+ @Serializable
45
51
data class ByTeam (override val duration : Duration ) : Enforced
52
+
53
+ @Serializable
46
54
data class ByGroup (override val duration : Duration ) : Enforced
47
55
}
48
56
@@ -78,11 +86,15 @@ sealed interface SelfDeletionTimer {
78
86
}
79
87
}
80
88
89
+ @Suppress(" EnforceSerializableFields" )
90
+ @Serializable
81
91
data class ConversationSelfDeletionStatus (
82
92
val conversationId : ConversationId ,
83
93
val selfDeletionTimer : SelfDeletionTimer
84
94
)
85
95
96
+ @Suppress(" EnforceSerializableFields" )
97
+ @Serializable
86
98
data class TeamSettingsSelfDeletionStatus (
87
99
/* *
88
100
* This value is used to inform the user that the team settings were changed. When true, an informative dialog will be shown. Once the
@@ -98,9 +110,16 @@ data class TeamSettingsSelfDeletionStatus(
98
110
val enforcedSelfDeletionTimer : TeamSelfDeleteTimer
99
111
)
100
112
113
+ @Serializable
101
114
sealed interface TeamSelfDeleteTimer {
115
+
116
+ @Serializable
102
117
data object Disabled : TeamSelfDeleteTimer
118
+
119
+ @Serializable
103
120
data object Enabled : TeamSelfDeleteTimer
121
+
122
+ @Serializable
104
123
data class Enforced (val enforcedDuration : Duration ) : TeamSelfDeleteTimer
105
124
106
125
fun toLogMap (eventDescription : String ): Map <String , Any ?> = mapOf (
0 commit comments