From 9b47e5202cbf9bc7d7f6066855e4564d16bccac6 Mon Sep 17 00:00:00 2001 From: ppfeiffer Date: Mon, 16 Feb 2026 17:55:26 +0100 Subject: [PATCH] fix: v0.3.12 - Filter own message echoes, fix sent message display Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 5 +++++ config.yaml | 2 +- meshbot/bot.py | 22 +++++++++++++--------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 305fe13..180a106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [0.3.12] - 2026-02-16 +### Fixed +- Eigene Nachrichten-Echos werden in _handle_packet gefiltert (keine Doppelspeicherung) +- Bot-Nachrichten erscheinen korrekt im Dashboard-Nachrichtenfenster + ## [0.3.11] - 2026-02-16 ### Changed - Sende-Zeile als eigene Card mit gruener Oberkante oberhalb der Nodes/Nachrichten-Cards diff --git a/config.yaml b/config.yaml index 90dc5e1..8d01b62 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -version: "0.3.11" +version: "0.3.12" bot: name: "MeshDD-Bot" diff --git a/meshbot/bot.py b/meshbot/bot.py index 1471790..3ce370b 100644 --- a/meshbot/bot.py +++ b/meshbot/bot.py @@ -241,16 +241,20 @@ class MeshBot: # Handle text messages if portnum == "TEXT_MESSAGE_APP": text = packet.get("decoded", {}).get("text", "") - msg = await self.db.insert_message(str(from_id), str(to_id), channel, portnum, text) - if self.ws_manager: - await self.ws_manager.broadcast("new_message", msg) - stats = await self.db.get_stats() - await self.ws_manager.broadcast("stats_update", stats) + my_id = self.get_my_node_id() + is_own = my_id and str(from_id) == my_id - # Process commands - prefix = config.get("bot.command_prefix", "!") - if text.startswith(prefix): - await self._handle_command(text.strip(), channel, str(from_id)) + if not is_own: + msg = await self.db.insert_message(str(from_id), str(to_id), channel, portnum, text) + if self.ws_manager: + await self.ws_manager.broadcast("new_message", msg) + stats = await self.db.get_stats() + await self.ws_manager.broadcast("stats_update", stats) + + # Process commands + prefix = config.get("bot.command_prefix", "!") + if text.startswith(prefix): + await self._handle_command(text.strip(), channel, str(from_id)) except Exception: logger.exception("Error handling packet")