diff --git a/src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt b/src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt index 027394e1..535a3bee 100644 --- a/src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt +++ b/src/main/kotlin/com/zoffcc/applications/trifa/MainActivity.kt @@ -133,7 +133,7 @@ import org.briarproject.briar.desktop.contact.ContactItem import org.briarproject.briar.desktop.contact.GroupItem import org.briarproject.briar.desktop.contact.GroupPeerItem import set_tox_online_state -import timestampMs +import com.zoffcc.applications.trifa2.timestampMs import toxdatastore import java.io.File import java.io.PrintWriter diff --git a/src/main/kotlin/com/zoffcc/applications/trifa2/ChatMessage.kt b/src/main/kotlin/com/zoffcc/applications/trifa2/ChatMessage.kt index 7e7d1b10..bbf8683d 100644 --- a/src/main/kotlin/com/zoffcc/applications/trifa2/ChatMessage.kt +++ b/src/main/kotlin/com/zoffcc/applications/trifa2/ChatMessage.kt @@ -69,6 +69,7 @@ import com.zoffcc.applications.trifa.HelperOSFile.show_file_in_explorer_or_open import com.zoffcc.applications.trifa.TRIFAGlobals import com.zoffcc.applications.trifa.TRIFAGlobals.TRIFA_MSG_TYPE import com.zoffcc.applications.trifa.ToxVars +import com.zoffcc.applications.trifa2.timeToString import org.briarproject.briar.desktop.ui.Tooltip import java.io.File import kotlin.random.Random diff --git a/src/main/kotlin/com/zoffcc/applications/trifa2/GroupChatMessage.kt b/src/main/kotlin/com/zoffcc/applications/trifa2/GroupChatMessage.kt index 1a3fe219..c950b52d 100644 --- a/src/main/kotlin/com/zoffcc/applications/trifa2/GroupChatMessage.kt +++ b/src/main/kotlin/com/zoffcc/applications/trifa2/GroupChatMessage.kt @@ -54,12 +54,11 @@ import androidx.compose.ui.unit.sp import com.vanniktech.emoji.emojiInformation import com.zoffcc.applications.trifa.HelperFiletransfer import com.zoffcc.applications.trifa.HelperGeneric -import com.zoffcc.applications.trifa.HelperGeneric.AsyncImage -import com.zoffcc.applications.trifa.HelperGeneric.loadImageBitmap import com.zoffcc.applications.trifa.HelperOSFile.open_webpage import com.zoffcc.applications.trifa.HelperOSFile.show_containing_dir_in_explorer import com.zoffcc.applications.trifa.HelperOSFile.show_file_in_explorer_or_open import com.zoffcc.applications.trifa.TRIFAGlobals +import com.zoffcc.applications.trifa2.timeToString import kotlinx.coroutines.DelicateCoroutinesApi import org.briarproject.briar.desktop.ui.Tooltip import java.io.File diff --git a/src/main/kotlin/com/zoffcc/applications/trifa2/currentTime.common.kt b/src/main/kotlin/com/zoffcc/applications/trifa2/currentTime.common.kt index 71a2b5df..063e448a 100644 --- a/src/main/kotlin/com/zoffcc/applications/trifa2/currentTime.common.kt +++ b/src/main/kotlin/com/zoffcc/applications/trifa2/currentTime.common.kt @@ -1,3 +1,5 @@ +package com.zoffcc.applications.trifa2 + import java.text.SimpleDateFormat import java.util.* @@ -5,10 +7,17 @@ import java.util.* val df_date_time_long = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") fun timeToString(timestampMs: Long): String { - return try { - df_date_time_long.format(Date(timestampMs)) + try { + if (timestampMs == 0L) + { + return "???" + } + else + { + return df_date_time_long.format(Date(timestampMs)) + } } catch (e: Exception) { - "1970-02-02 12:00:01" + return "1970-02-02 12:00:01" } }