From ba557e2b9d606affa5e5f9dc180efab3e088cd1e Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 7 Sep 2026 22:36:23 +0300 Subject: [PATCH] =?UTF-8?q?chat:=20=D1=84=D0=B8=D0=BA=D1=81=200:00=20?= =?UTF-8?q?=D1=83=20=D0=B4=D0=BB=D0=B8=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B3?= =?UTF-8?q?=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2=D1=8B=D1=85=20=E2=80=94=20?= =?UTF-8?q?b64=5Fdecode=20=D1=82=D0=B5=D1=80=D1=8F=D0=BB=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B8=D0=B9=20=D0=B1=D0=B0=D0=B9?= =?UTF-8?q?=D1=82=20=D0=B1=D0=B5=D0=B7=20padding=20+=20formatTime=20=D0=B2?= =?UTF-8?q?=20=D0=BC=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/chat_core_priv.h | 2 +- .../main/java/com/utun/chat/ui/components/MessageBubble.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/chat/chat_core_priv.h b/src/chat/chat_core_priv.h index af6d9f88..1c03a193 100644 --- a/src/chat/chat_core_priv.h +++ b/src/chat/chat_core_priv.h @@ -59,7 +59,7 @@ static inline size_t b64_decode(const char* src, size_t src_len, uint8_t* dst, s if (vi == 4) { dst[out++] = (uint8_t)((vals[0] << 2) | (vals[1] >> 4)); if (out < dst_cap) dst[out++] = (uint8_t)((vals[1] << 4) | (vals[2] >> 2)); - if (out < dst_cap && i + 1 < src_len && src[i + 1] != '=') + if (out < dst_cap) dst[out++] = (uint8_t)((vals[2] << 6) | vals[3]); vi = 0; } diff --git a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt index 6e0f86d4..f384b33b 100644 --- a/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt +++ b/tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt @@ -449,8 +449,6 @@ private fun formatDuration(ms: Int): String { private fun formatTime(ts: Long): String { if (ts == 0L) return "" - val s = ts / 1_000_000_000 - val h = (s / 3600) % 24 - val m = (s / 60) % 60 - return "%02d:%02d".format(h, m) + val dt = java.time.Instant.ofEpochMilli(ts).atZone(java.time.ZoneId.systemDefault()) + return "%02d:%02d".format(dt.hour, dt.minute) }