fix: ensure valid column index (#462)
* fix: ensure valid column index See: https://github.com/FossifyOrg/Messages/issues/461 * refactor: use extension from commons * docs: update changelog
This commit is contained in:
parent
fb7a394478
commit
ce5b35737f
2 changed files with 11 additions and 1 deletions
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed inability to view messages when there is no SIM card ([#461])
|
||||||
|
|
||||||
## [1.2.1] - 2025-06-17
|
## [1.2.1] - 2025-06-17
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
@ -171,3 +175,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
[#279]: https://github.com/FossifyOrg/Messages/issues/279
|
[#279]: https://github.com/FossifyOrg/Messages/issues/279
|
||||||
[#287]: https://github.com/FossifyOrg/Messages/issues/287
|
[#287]: https://github.com/FossifyOrg/Messages/issues/287
|
||||||
[#294]: https://github.com/FossifyOrg/Messages/issues/294
|
[#294]: https://github.com/FossifyOrg/Messages/issues/294
|
||||||
|
[#461]: https://github.com/FossifyOrg/Messages/issues/461
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import me.leolin.shortcutbadger.ShortcutBadger
|
||||||
import org.fossify.commons.extensions.areDigitsOnly
|
import org.fossify.commons.extensions.areDigitsOnly
|
||||||
import org.fossify.commons.extensions.getBlockedNumbers
|
import org.fossify.commons.extensions.getBlockedNumbers
|
||||||
import org.fossify.commons.extensions.getIntValue
|
import org.fossify.commons.extensions.getIntValue
|
||||||
|
import org.fossify.commons.extensions.getIntValueOr
|
||||||
import org.fossify.commons.extensions.getLongValue
|
import org.fossify.commons.extensions.getLongValue
|
||||||
import org.fossify.commons.extensions.getMyContactsCursor
|
import org.fossify.commons.extensions.getMyContactsCursor
|
||||||
import org.fossify.commons.extensions.getStringValue
|
import org.fossify.commons.extensions.getStringValue
|
||||||
|
|
@ -161,7 +162,11 @@ fun Context.getMessages(
|
||||||
val date = (cursor.getLongValue(Sms.DATE) / 1000).toInt()
|
val date = (cursor.getLongValue(Sms.DATE) / 1000).toInt()
|
||||||
val read = cursor.getIntValue(Sms.READ) == 1
|
val read = cursor.getIntValue(Sms.READ) == 1
|
||||||
val thread = cursor.getLongValue(Sms.THREAD_ID)
|
val thread = cursor.getLongValue(Sms.THREAD_ID)
|
||||||
val subscriptionId = cursor.getIntValue(Sms.SUBSCRIPTION_ID)
|
val subscriptionId = cursor.getIntValueOr(
|
||||||
|
key = Sms.SUBSCRIPTION_ID,
|
||||||
|
defaultValue = SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||||
|
)
|
||||||
|
|
||||||
val status = cursor.getIntValue(Sms.STATUS)
|
val status = cursor.getIntValue(Sms.STATUS)
|
||||||
val participants = senderNumber.split(ADDRESS_SEPARATOR).map { number ->
|
val participants = senderNumber.split(ADDRESS_SEPARATOR).map { number ->
|
||||||
val phoneNumber = PhoneNumber(number, 0, "", number)
|
val phoneNumber = PhoneNumber(number, 0, "", number)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue