add meaningful names

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-05-20 09:26:38 +02:00 committed by Marcel Hibbe
parent d6a2a1fe27
commit 6659b664d8
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 15 additions and 12 deletions

View File

@ -669,7 +669,8 @@ class ChatActivity :
} }
} }
if (currentConversation?.objectType == ConversationEnums.ObjectType.EVENT && hasSpreedFeatureCapability( if (currentConversation?.objectType == ConversationEnums.ObjectType.EVENT &&
hasSpreedFeatureCapability(
conversationUser?.capabilities!!.spreedCapability!!, conversationUser?.capabilities!!.spreedCapability!!,
SpreedFeatures.UNBIND_CONVERSATION SpreedFeatures.UNBIND_CONVERSATION
) )
@ -683,7 +684,8 @@ class ChatActivity :
} }
} }
if (currentConversation?.objectType == ConversationEnums.ObjectType.PHONE && hasSpreedFeatureCapability( if (currentConversation?.objectType == ConversationEnums.ObjectType.PHONE &&
hasSpreedFeatureCapability(
conversationUser?.capabilities!!.spreedCapability!!, conversationUser?.capabilities!!.spreedCapability!!,
SpreedFeatures.UNBIND_CONVERSATION SpreedFeatures.UNBIND_CONVERSATION
) )
@ -699,7 +701,8 @@ class ChatActivity :
} }
} }
if (currentConversation?.objectType == ConversationEnums.ObjectType.INSTANT_MEETING && hasSpreedFeatureCapability( if (currentConversation?.objectType == ConversationEnums.ObjectType.INSTANT_MEETING &&
hasSpreedFeatureCapability(
conversationUser?.capabilities!!.spreedCapability!!, conversationUser?.capabilities!!.spreedCapability!!,
SpreedFeatures.UNBIND_CONVERSATION SpreedFeatures.UNBIND_CONVERSATION
) )
@ -1231,19 +1234,18 @@ class ChatActivity :
} }
val deleteNoticeText = binding.conversationDeleteNotice.findViewById<TextView>(R.id.deletion_message) val deleteNoticeText = binding.conversationDeleteNotice.findViewById<TextView>(R.id.deletion_message)
if(currentConversation?.objectType!= ConversationEnums.ObjectType.INSTANT_MEETING){ if (currentConversation?.objectType != ConversationEnums.ObjectType.INSTANT_MEETING) {
deleteNoticeText.text = String.format( deleteNoticeText.text = String.format(
resources.getString(R.string.nc_conversation_auto_delete_notice), resources.getString(R.string.nc_conversation_auto_delete_notice),
retentionPeriod retentionPeriod
) )
}else{ } else {
deleteNoticeText.text = String.format( deleteNoticeText.text = String.format(
resources.getString(R.string.nc_conversation_auto_delete_warning), resources.getString(R.string.nc_conversation_auto_delete_warning),
retentionPeriod retentionPeriod
) )
} }
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.delete_now_button).setOnClickListener { binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.delete_now_button).setOnClickListener {
deleteConversationDialog(it.context) deleteConversationDialog(it.context)
} }

View File

@ -523,7 +523,7 @@ class ConversationsListActivity :
nearFutureEventConversationItems.clear() nearFutureEventConversationItems.clear()
for (conversation in list) { for (conversation in list) {
if (!futureEvent(conversation)) { if (!isFutureEvent(conversation)) {
addToNearFutureEventConversationItems(conversation) addToNearFutureEventConversationItems(conversation)
} }
addToConversationItems(conversation) addToConversationItems(conversation)
@ -564,13 +564,14 @@ class ConversationsListActivity :
return false return false
} }
private fun futureEvent(conversation: ConversationModel): Boolean { private fun isFutureEvent(conversation: ConversationModel): Boolean {
if (!conversation.objectId.contains("#")) { if (!conversation.objectId.contains("#")) {
return false return false
} }
return conversation.objectType == ConversationEnums.ObjectType.EVENT && val eventTimeStart = conversation.objectId.split("#")[0].toLong()
(conversation.objectId.split("#")[0].toLong() - (System.currentTimeMillis() / LONG_1000)) > val currentTimeStampInSeconds = System.currentTimeMillis() / LONG_1000
AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS val sixteenHoursAfterTimeStamp = (eventTimeStart - currentTimeStampInSeconds) > SIXTEEN_HOURS_IN_SECONDS
return conversation.objectType == ConversationEnums.ObjectType.EVENT && sixteenHoursAfterTimeStamp
} }
fun showOnlyNearFutureEvents() { fun showOnlyNearFutureEvents() {
@ -2156,7 +2157,7 @@ class ConversationsListActivity :
const val NOTIFICATION_WARNING_DATE_NOT_SET = 0L const val NOTIFICATION_WARNING_DATE_NOT_SET = 0L
const val OFFSET_HEIGHT_DIVIDER: Int = 3 const val OFFSET_HEIGHT_DIVIDER: Int = 3
const val ROOM_TYPE_ONE_ONE = "1" const val ROOM_TYPE_ONE_ONE = "1"
private const val AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS: Long = 57600 private const val SIXTEEN_HOURS_IN_SECONDS: Long = 57600
const val LONG_1000: Long = 1000 const val LONG_1000: Long = 1000
} }
} }