[PR #2020] [MERGED] Chat: a LAN guest's line follows the host's Chat option #3943

Closed
opened 2026-11-03 04:13:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2020
Author: @levzzz5154
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/guest-chat-visibility


📝 Commits (3)

  • 276f8d4 Chat: a LAN guest's line follows the host's Chat option
  • fb74b60 Chat: system and player lines share the window's chat code
  • ee83d8f Chat test: set the abilities through set_abilities (clippy)

📊 Changes

3 files changed (+60 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/chat_tests.rs (+31 -0)
📝 crates/horizon-client/src/game/chat.rs (+24 -3)
📝 crates/horizon-client/src/game/lan.rs (+5 -1)

📄 Description

🤖 Opened by levzzz5154's AI agent ([CC], deepseek-v4.1-flash), not by levzzz5154.

What and why

Follow-up to #1932, from rdbtCVS's review there ([P2], game/chat.rs:468): with --in-frame, opening a world
to LAN and setting Commands Only still showed a guest's ordinary chat on the host.

The hub reports every chat line as HostEvent::Chat, and lan_log_event showed it through system_message,
which asks receive_system_messages — true at Commands Only, so the line passed. Player chat needs
receive_player_messages, the permission ChatListener checks (showMessageToPlayer) and the one the guests'
own packets already go through (ChatSource::Player).

  • game/chat.rs: Game::player_message adds a line as ChatSource::Player (the same filter, mods hook and
    capture as system_message), and does nothing on a server's client, which filters the packet instead.
  • game/lan.rs: lan_log_event sends HostEvent::Chat there. /say and /me arrive as chat messages
    (say_command, emote_command) and follow the same permission, as they do for the guests; command feedback
    such as /list or /tp is a system message and keeps the system-message permission, so it still shows.

Verification

Two real games, in-frame host at Commands Only (horizon-ctl in both, publish + connect, guest on its own
HORIZON_HOME):

Build Host's Chat Guest sends Host shows
before this change (c31e8b23) Commands Only baseline-visible <Guest9> baseline-visible
this branch Commands Only hidden-fixed, rebased-hidden nothing
this branch Shown shown-fixed, rebased-shown <Guest9> shown-fixed, <Guest9> rebased-shown

a_guests_line_follows_the_player_message_permission pins the three levels for player and system sources.

Scope

3 files, +72 −1 (game/chat.rs, game/lan.rs, chat_tests.rs).

🤖 Generated with [CC].

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, merge base 8cf51888, 2 min 31 s)

Check Result
Scope ✅ 3 files, +67 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ❌ failed (9 s)
tests: horizon-client ✅ 1290 passed (2 min 10 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 257 affected, to run in CI (--quick)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

clippy fails on crates/horizon-client/src/mobs/axolotl.rs:169 (overly_complex_bool_expr), which fails the same way on upstream/main at 8cf51888: nothing in this branch touches it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2020 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/guest-chat-visibility` --- ### 📝 Commits (3) - [`276f8d4`](https://github.com/horizon-rust/horizon/commit/276f8d49c133df03f05c0670c55b2e59a2aa844a) Chat: a LAN guest's line follows the host's Chat option - [`fb74b60`](https://github.com/horizon-rust/horizon/commit/fb74b6038f026f5b09ddf1a85b2c64fe636648f9) Chat: system and player lines share the window's chat code - [`ee83d8f`](https://github.com/horizon-rust/horizon/commit/ee83d8f2475063b157b41f87a83237362eb35f06) Chat test: set the abilities through set_abilities (clippy) ### 📊 Changes **3 files changed** (+60 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/chat_tests.rs` (+31 -0) 📝 `crates/horizon-client/src/game/chat.rs` (+24 -3) 📝 `crates/horizon-client/src/game/lan.rs` (+5 -1) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent ([CC], deepseek-v4.1-flash), not by levzzz5154. ## What and why Follow-up to #1932, from rdbtCVS's review there ([P2], `game/chat.rs:468`): with `--in-frame`, opening a world to LAN and setting Commands Only still showed a guest's ordinary chat on the host. The hub reports every chat line as `HostEvent::Chat`, and `lan_log_event` showed it through `system_message`, which asks `receive_system_messages` — true at Commands Only, so the line passed. Player chat needs `receive_player_messages`, the permission `ChatListener` checks (`showMessageToPlayer`) and the one the guests' own packets already go through (`ChatSource::Player`). - `game/chat.rs`: `Game::player_message` adds a line as `ChatSource::Player` (the same filter, mods hook and capture as `system_message`), and does nothing on a server's client, which filters the packet instead. - `game/lan.rs`: `lan_log_event` sends `HostEvent::Chat` there. `/say` and `/me` arrive as chat messages (`say_command`, `emote_command`) and follow the same permission, as they do for the guests; command feedback such as `/list` or `/tp` is a system message and keeps the system-message permission, so it still shows. ## Verification Two real games, in-frame host at Commands Only (`horizon-ctl` in both, `publish` + `connect`, guest on its own `HORIZON_HOME`): | Build | Host's Chat | Guest sends | Host shows | | --- | --- | --- | --- | | before this change (c31e8b23) | Commands Only | `baseline-visible` | `<Guest9> baseline-visible` | | this branch | Commands Only | `hidden-fixed`, `rebased-hidden` | nothing | | this branch | Shown | `shown-fixed`, `rebased-shown` | `<Guest9> shown-fixed`, `<Guest9> rebased-shown` | `a_guests_line_follows_the_player_message_permission` pins the three levels for player and system sources. ## Scope 3 files, +72 −1 (`game/chat.rs`, `game/lan.rs`, `chat_tests.rs`). 🤖 Generated with [[CC]](https://github.com/levzzz5154/horizon). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, merge base 8cf51888, 2 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +67 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ❌ failed (9 s) | | tests: horizon-client | ✅ 1290 passed (2 min 10 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 257 affected, to run in CI (--quick) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `clippy` fails on `crates/horizon-client/src/mobs/axolotl.rs:169` (`overly_complex_bool_expr`), which fails the same way on `upstream/main` at 8cf51888: nothing in this branch touches it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:27 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3943
No description provided.