diff --git a/client/public/version.js b/client/public/version.js index 24715d1..1700597 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.25 R260"; +window.CHGRID_WEB_VERSION = "2026.02.25 R261"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/server/app/items/types/radio_station/actions.py b/server/app/items/types/radio_station/actions.py index edf5cb7..2c3b2c5 100644 --- a/server/app/items/types/radio_station/actions.py +++ b/server/app/items/types/radio_station/actions.py @@ -27,7 +27,7 @@ def secondary_use_item(item: WorldItem, _nickname: str, _clock_formatter: Callab if item.params.get("enabled") is False: return ItemUseResult( self_message=f"{item.title} is off.", - others_message=f"{item.title} is off.", + others_message="", ) station_name = str(item.params.get("stationName", "")).strip() @@ -40,4 +40,4 @@ def secondary_use_item(item: WorldItem, _nickname: str, _clock_formatter: Callab message = f"Playing from {station_name}." else: message = "No now playing data." - return ItemUseResult(self_message=message, others_message=message) + return ItemUseResult(self_message=message, others_message="") diff --git a/server/app/server.py b/server/app/server.py index cf0042e..7f873bf 100644 --- a/server/app/server.py +++ b/server/app/server.py @@ -1708,10 +1708,11 @@ class SignalingServer: item.version += 1 self._request_state_save() await self._broadcast_item(item) - await self._broadcast( - BroadcastChatMessagePacket(type="chat_message", message=secondary_result.others_message, system=True), - exclude=client.websocket, - ) + if secondary_result.others_message.strip(): + await self._broadcast( + BroadcastChatMessagePacket(type="chat_message", message=secondary_result.others_message, system=True), + exclude=client.websocket, + ) await self._send_item_result(client, True, "secondary_use", secondary_result.self_message, item.id) return diff --git a/server/tests/test_server_message_handling.py b/server/tests/test_server_message_handling.py index 9970e0f..4c3b1e8 100644 --- a/server/tests/test_server_message_handling.py +++ b/server/tests/test_server_message_handling.py @@ -118,12 +118,13 @@ async def test_item_secondary_use_radio_reports_now_playing(monkeypatch: pytest. server.item_service.add_item(radio) send_payloads: list[object] = [] + broadcast_payloads: list[object] = [] async def fake_send(websocket: ServerConnection, packet: object) -> None: send_payloads.append(packet) async def fake_broadcast(packet: object, exclude: ServerConnection | None = None) -> None: - return None + broadcast_payloads.append(packet) monkeypatch.setattr(server, "_send", fake_send) monkeypatch.setattr(server, "_broadcast", fake_broadcast) @@ -135,6 +136,7 @@ async def test_item_secondary_use_radio_reports_now_playing(monkeypatch: pytest. assert results[-1].ok is True assert results[-1].action == "secondary_use" assert "Playing Song Y from Station X." in results[-1].message + assert broadcast_payloads == [] @pytest.mark.asyncio