фикс: режим уведомлений канала читался у первого канала — getChannel() затирал индекс канала

This commit is contained in:
shade committed 2026-10-15 20:33:46 +03:00
1 parent bd7e0b6358
commit c3542b3394
1 file changed
+3 -1
+3 -1
View File
@@ -590,10 +590,12 @@ void MyMesh::onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packe
if (_listener) {
// Get the channel name from the channel index
ChannelDetails channel_details;
channel_details.channel_idx = channel_idx; // UI использует индекс для настроек по каналам
if (!getChannel(channel_idx, channel_details)) {
strcpy(channel_details.name, "Unknown");
}
// ВАЖНО: индекс канала ставим ПОСЛЕ getChannel — она копирует структуру целиком
// и затирает всё, что записано до неё (иначе UI читал режим первого канала).
channel_details.channel_idx = channel_idx;
_listener->onChannelMessageRecv(pkt, channel_details, text);
_listener->onQueueSizeChanged(offline_queue_len);
}