@@ -80,7 +80,7 @@ class Mailbox : RealmObject {
80
80
@Transient
81
81
var signatures = realmListOf<Signature >()
82
82
@Transient
83
- private var _featureFlags = realmSetOf<String >()
83
+ var _featureFlags = realmSetOf<String >()
84
84
@Transient
85
85
var externalMailFlagEnabled: Boolean = false
86
86
@Transient
@@ -108,12 +108,25 @@ class Mailbox : RealmObject {
108
108
109
109
private fun createObjectId (userId : Int ): String = " ${userId} _${this .mailboxId} "
110
110
111
- fun initLocalValues (userId : Int , quotas : Quotas ? , inboxUnreadCount : Int , permissions : MailboxPermissions ? ) {
111
+ fun initLocalValues (
112
+ userId : Int ,
113
+ quotas : Quotas ? ,
114
+ inboxUnreadCount : Int? ,
115
+ permissions : MailboxPermissions ? ,
116
+ signatures : List <Signature >? ,
117
+ featureFlags : Set <String >? ,
118
+ externalMailFlagEnabled : Boolean? ,
119
+ trustedDomains : List <String >? ,
120
+ ) {
112
121
this .objectId = createObjectId(userId)
113
122
this .userId = userId
114
123
this .quotas = quotas
115
- this .unreadCountLocal = inboxUnreadCount
124
+ this .unreadCountLocal = inboxUnreadCount ? : 0
116
125
this .permissions = permissions
126
+ signatures?.let (this .signatures::addAll)
127
+ featureFlags?.let (this ._featureFlags ::addAll)
128
+ this .externalMailFlagEnabled = externalMailFlagEnabled ? : false
129
+ trustedDomains?.let (this .trustedDomains::addAll)
117
130
}
118
131
119
132
fun getDefaultSignatureWithFallback (draftMode : DraftMode ? = null): Signature {
0 commit comments