From 81fdbf90e143cacc345bc4ed2ae96661afc4df5a Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 27 Oct 2026 07:25:26 +0100 Subject: [PATCH] fix(chat): skip initial sound publication when preference reading fails --- src/chat/chat_profile.c | 1 + src/chat/chat_sync.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chat/chat_profile.c b/src/chat/chat_profile.c index ff2d3b762..f091acbbd 100644 --- a/src/chat/chat_profile.c +++ b/src/chat/chat_profile.c @@ -24,6 +24,7 @@ #include "../../lib/platform_compat.h" #include +#include void chat_core_set_my_node_id(struct UTUN_INSTANCE* inst, uint64_t node_id) { struct chat_core_ctx* cc = CC(inst); diff --git a/src/chat/chat_sync.c b/src/chat/chat_sync.c index 3356b6c23..48683b4a9 100644 --- a/src/chat/chat_sync.c +++ b/src/chat/chat_sync.c @@ -598,7 +598,9 @@ void chat_sync_broadcast_sound_setting(struct UTUN_INSTANCE* inst, const char* c static void cs_send_all_sound_settings(struct chat_sync* cs, uint64_t peer) { for (int i = 0; i < cs->channel_count; i++) { int on = chat_core_get_sound_on_message(cs->inst, cs->channels[i].channel_id); - cs_send_sound_setting(cs, cs->channels[i].channel_id, peer, on); + if (on >= 0) cs_send_sound_setting(cs, cs->channels[i].channel_id, peer, on); + else DEBUG_WARN(DEBUG_CATEGORY_CHAT_SYNC, "sound setting: skip unreadable channel=%s peer=%016llx", + cs->channels[i].channel_id, (unsigned long long)peer); } }