Sender defaults to wrong address on reply/forward

We were using a wrongly sorted list to choose the correct address from,
now we use the address list inside the correct user and since the keys
start from 1 and positions from 0 that is why we had to subtract 1.

MAILAND-2846
This commit is contained in:
Zorica Stojchevska 2022-04-13 19:11:12 +02:00
parent 8069aeb6af
commit aa55a9d7cb
1 changed files with 2 additions and 1 deletions

View File

@ -559,7 +559,8 @@ class ComposeMessageViewModel @Inject constructor(
_senderAddresses = senderAddresses
}
fun getPositionByAddressId(): Int = legacyUser.getPositionByAddressId(_messageDataResult.addressId)
fun getPositionByAddressId(): Int =
user.addresses.addresses.filter { it.value.id.id == _messageDataResult.addressId }.keys.first() - 1
fun isPaidUser(): Boolean = legacyUser.isPaidUser