Make radio secondary now-playing message self-only
This commit is contained in:
@@ -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="")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user