From 2bdcdc034d53386dade45f8d8562821a87144f8d Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Fri, 2 Aug 2024 19:14:35 -0400 Subject: [PATCH] Now reporting chat messages via MQTT. --- owrx/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/owrx/client.py b/owrx/client.py index 793b4a6c..7ffc6d02 100644 --- a/owrx/client.py +++ b/owrx/client.py @@ -1,5 +1,6 @@ from owrx.config import Config from owrx.color import ColorCache +from owrx.reporting import ReportingEngine from datetime import datetime, timedelta from ipaddress import ip_address import threading @@ -104,6 +105,14 @@ class ClientRegistry(object): self.chat[client] = { "name": name, "color": color } self.chatCount = self.chatCount + 1 + # Report message + ReportingEngine.getSharedInstance().spot({ + "mode" : "CHAT", + "timestamp" : round(datetime.now().timestamp() * 1000), + "name" : name, + "message" : text + }) + # Broadcast message to all clients for c in self.clients: c.write_chat_message(name, text, color)