Push empty convos to bottom and hide thread date when unknown

pull/1313/head
Andrew 3 months ago
parent 1a81c7278a
commit 1c38fc000a

@ -496,7 +496,7 @@ open class Storage(
// create note to self thread if needed (?)
val address = recipient.address
val ourThread = getThreadId(address) ?: getOrCreateThreadIdFor(address).also {
setThreadDate(it, SnodeAPI.nowWithOffset - 14.days.inWholeMilliseconds)
setThreadDate(it, 0)
}
DatabaseComponent.get(context).threadDatabase().setHasSent(ourThread, true)
setPinned(ourThread, userProfile.getNtsPriority() > 0)
@ -1188,7 +1188,7 @@ open class Storage(
} else {
(
getThreadId(address) ?: getOrCreateThreadIdFor(address).also {
setThreadDate(it, SnodeAPI.nowWithOffset - 14.days.inWholeMilliseconds)
setThreadDate(it, 0)
}
).also { setPinned(it, contact.priority == PRIORITY_PINNED) }
}

@ -92,7 +92,7 @@ class ConversationView : LinearLayout {
val senderDisplayName = getUserDisplayName(thread.recipient)
?: thread.recipient.address.toString()
binding.conversationViewDisplayNameTextView.text = senderDisplayName
binding.timestampTextView.text = DateUtils.getDisplayFormattedTimeSpanString(context, Locale.getDefault(), thread.date)
binding.timestampTextView.text = thread.date.takeIf { it != 0L }?.let { DateUtils.getDisplayFormattedTimeSpanString(context, Locale.getDefault(), it) }
val recipient = thread.recipient
binding.muteIndicatorImageView.isVisible = recipient.isMuted || recipient.notifyType != NOTIFY_TYPE_ALL
val drawableRes = if (recipient.isMuted || recipient.notifyType == NOTIFY_TYPE_NONE) {

Loading…
Cancel
Save