mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix(cli): Replace 'public' command with 'chan 0' to fix quote handling
Issue: Messages sent to Public channel had visible double quotes around multi-word text (e.g., "Hello world" appeared as "Hello world" in chat). Root cause: In interactive mode, meshcli's 'public' command treats quotes literally as part of message content, while 'chan' command correctly parses them as argument delimiters. Solution: Use 'chan 0' for Public channel instead of 'public' command. This ensures consistent quote handling across all channels. Before: - Public (ch 0): public "message" → quotes visible in output - Other channels: chan <nb> "message" → quotes correctly parsed ✓ After: - All channels: chan <nb> "message" → consistent behavior ✓ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,12 +100,9 @@ def send_message(text: str, reply_to: Optional[str] = None, channel_index: int =
|
||||
else:
|
||||
message = text
|
||||
|
||||
if channel_index == 0:
|
||||
# Public channel - backward compatibility
|
||||
success, stdout, stderr = _run_command(['public', message])
|
||||
else:
|
||||
# Other channels - use 'chan' command
|
||||
success, stdout, stderr = _run_command(['chan', str(channel_index), message])
|
||||
# Use 'chan' command for all channels (including Public/0) for consistent quoting behavior
|
||||
# Note: 'public' command treats quotes literally, while 'chan' properly parses them as delimiters
|
||||
success, stdout, stderr = _run_command(['chan', str(channel_index), message])
|
||||
|
||||
return success, stdout or stderr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user