added last talking info to Audio Pannel

This commit is contained in:
PxlLoewe
2025-05-21 15:20:04 -07:00
parent c2799fbb49
commit f22335b1bf
6 changed files with 82 additions and 16 deletions

View File

@@ -83,6 +83,22 @@ export const handleConnectDispatch =
io.to("dispatchers").emit("dispatchers-update");
io.to("pilots").emit("dispatchers-update");
// dispatch-events
socket.on("ptt", async ({ shouldTransmit, channel }) => {
if (shouldTransmit) {
io.to("dispatchers").emit("other-ptt", {
publicUser: getPublicUser(user),
channel,
source: "Leitstelle",
});
io.to("piots").emit("other-ptt", {
publicUser: getPublicUser(user),
channel,
source: "Leitstelle",
});
}
});
socket.on("disconnect", async () => {
console.log("Disconnected from dispatch server");
await prisma.connectedDispatcher.update({