Fix block command documentation and add to autocomplete

- Change @user to @name in all documentation
- Change 'blocked users' to 'blocked peers' for consistency
- Add /block and /unblock commands to autocomplete menu
This commit is contained in:
jack
2025-07-08 03:03:21 +02:00
parent e4d5f5b940
commit 9ec8008695
4 changed files with 25 additions and 23 deletions
+5 -5
View File
@@ -63,15 +63,15 @@ This project is released into the public domain. See the [LICENSE](LICENSE) file
### Basic Commands
- `/j #channel` - Join or create a channel
- `/m @user message` - Send a private message
- `/m @name message` - Send a private message
- `/w` - List online users
- `/channels` - Show all discovered channels
- `/block @user` - Block a user from messaging you
- `/block` - List all blocked users
- `/unblock @user` - Unblock a user
- `/block @name` - Block a peer from messaging you
- `/block` - List all blocked peers
- `/unblock @name` - Unblock a peer
- `/clear` - Clear chat messages
- `/pass [password]` - Set/change channel password (owner only)
- `/transfer @user` - Transfer channel ownership
- `/transfer @name` - Transfer channel ownership
- `/save` - Toggle message retention for channel (owner only)
### Getting Started
+3 -3
View File
@@ -2256,7 +2256,7 @@ extension ChatViewModel: BitchatDelegate {
if blockedUsers.isEmpty {
let systemMessage = BitchatMessage(
sender: "system",
content: "no blocked users.",
content: "no blocked peers.",
timestamp: Date(),
isRelay: false
)
@@ -2280,10 +2280,10 @@ extension ChatViewModel: BitchatDelegate {
}
}
let blockedList = blockedNicknames.isEmpty ? "blocked users (not currently online)" : blockedNicknames.sorted().joined(separator: ", ")
let blockedList = blockedNicknames.isEmpty ? "blocked peers (not currently online)" : blockedNicknames.sorted().joined(separator: ", ")
let systemMessage = BitchatMessage(
sender: "system",
content: "blocked users: \(blockedList)",
content: "blocked peers: \(blockedList)",
timestamp: Date(),
isRelay: false
)
+12 -12
View File
@@ -108,15 +108,15 @@ struct AppInfoView: View {
VStack(alignment: .leading, spacing: 8) {
Text("/j #channel - join or create a channel")
Text("/m @user - send private message")
Text("/m @name - send private message")
Text("/w - see who's online")
Text("/channels - show all discovered channels")
Text("/block @user - block a user")
Text("/block - list blocked users")
Text("/unblock @user - unblock a user")
Text("/block @name - block a peer")
Text("/block - list blocked peers")
Text("/unblock @name - unblock a peer")
Text("/clear - clear current chat")
Text("/hug @user - send someone a hug")
Text("/slap @user - slap with a trout")
Text("/hug @name - send someone a hug")
Text("/slap @name - slap with a trout")
}
.font(.system(size: 14, design: .monospaced))
.foregroundColor(textColor)
@@ -234,15 +234,15 @@ struct AppInfoView: View {
VStack(alignment: .leading, spacing: 8) {
Text("/j #channel - join or create a channel")
Text("/m @user - send private message")
Text("/m @name - send private message")
Text("/w - see who's online")
Text("/channels - show all discovered channels")
Text("/block @user - block a user")
Text("/block - list blocked users")
Text("/unblock @user - unblock a user")
Text("/block @name - block a peer")
Text("/block - list blocked peers")
Text("/unblock @name - unblock a peer")
Text("/clear - clear current chat")
Text("/hug @user - send someone a hug")
Text("/slap @user - slap with a trout")
Text("/hug @name - send someone a hug")
Text("/slap @name - slap with a trout")
}
.font(.system(size: 14, design: .monospaced))
.foregroundColor(textColor)
+5 -3
View File
@@ -519,12 +519,14 @@ struct ContentView: View {
VStack(alignment: .leading, spacing: 0) {
// Define commands with aliases and syntax
let commandInfo: [(commands: [String], syntax: String?, description: String)] = [
(["/block"], "[nickname]", "block or list blocked peers"),
(["/clear"], nil, "clear chat messages"),
(["/hug"], "<nickname>", "send someone a warm hug"),
(["/j", "/join"], "<channel>", "join or create a channel"),
(["/m", "/msg"], "<nickname> [message]", "send private message"),
(["/channels"], nil, "show all discovered channels"),
(["/slap"], "<nickname>", "slap someone with a trout"),
(["/unblock"], "<nickname>", "unblock a peer"),
(["/w"], nil, "see who's online")
]
@@ -625,14 +627,14 @@ struct ContentView: View {
if newValue.hasPrefix("/") && newValue.count >= 1 {
// Build context-aware command list
var commandDescriptions = [
("/block", "block or list blocked users"),
("/block", "block or list blocked peers"),
("/channels", "show all discovered channels"),
("/clear", "clear chat messages"),
("/hug", "send someone a warm hug"),
("/j", "join or create a channel"),
("/m", "send private message"),
("/channels", "show all discovered channels"),
("/slap", "slap someone with a trout"),
("/unblock", "unblock a user"),
("/unblock", "unblock a peer"),
("/w", "see who's online")
]