mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-24 23:45:18 +00:00
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:
@@ -63,15 +63,15 @@ This project is released into the public domain. See the [LICENSE](LICENSE) file
|
|||||||
### Basic Commands
|
### Basic Commands
|
||||||
|
|
||||||
- `/j #channel` - Join or create a channel
|
- `/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
|
- `/w` - List online users
|
||||||
- `/channels` - Show all discovered channels
|
- `/channels` - Show all discovered channels
|
||||||
- `/block @user` - Block a user from messaging you
|
- `/block @name` - Block a peer from messaging you
|
||||||
- `/block` - List all blocked users
|
- `/block` - List all blocked peers
|
||||||
- `/unblock @user` - Unblock a user
|
- `/unblock @name` - Unblock a peer
|
||||||
- `/clear` - Clear chat messages
|
- `/clear` - Clear chat messages
|
||||||
- `/pass [password]` - Set/change channel password (owner only)
|
- `/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)
|
- `/save` - Toggle message retention for channel (owner only)
|
||||||
|
|
||||||
### Getting Started
|
### Getting Started
|
||||||
|
|||||||
@@ -2256,7 +2256,7 @@ extension ChatViewModel: BitchatDelegate {
|
|||||||
if blockedUsers.isEmpty {
|
if blockedUsers.isEmpty {
|
||||||
let systemMessage = BitchatMessage(
|
let systemMessage = BitchatMessage(
|
||||||
sender: "system",
|
sender: "system",
|
||||||
content: "no blocked users.",
|
content: "no blocked peers.",
|
||||||
timestamp: Date(),
|
timestamp: Date(),
|
||||||
isRelay: false
|
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(
|
let systemMessage = BitchatMessage(
|
||||||
sender: "system",
|
sender: "system",
|
||||||
content: "blocked users: \(blockedList)",
|
content: "blocked peers: \(blockedList)",
|
||||||
timestamp: Date(),
|
timestamp: Date(),
|
||||||
isRelay: false
|
isRelay: false
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -108,15 +108,15 @@ struct AppInfoView: View {
|
|||||||
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("/j #channel - join or create a channel")
|
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("/w - see who's online")
|
||||||
Text("/channels - show all discovered channels")
|
Text("/channels - show all discovered channels")
|
||||||
Text("/block @user - block a user")
|
Text("/block @name - block a peer")
|
||||||
Text("/block - list blocked users")
|
Text("/block - list blocked peers")
|
||||||
Text("/unblock @user - unblock a user")
|
Text("/unblock @name - unblock a peer")
|
||||||
Text("/clear - clear current chat")
|
Text("/clear - clear current chat")
|
||||||
Text("/hug @user - send someone a hug")
|
Text("/hug @name - send someone a hug")
|
||||||
Text("/slap @user - slap with a trout")
|
Text("/slap @name - slap with a trout")
|
||||||
}
|
}
|
||||||
.font(.system(size: 14, design: .monospaced))
|
.font(.system(size: 14, design: .monospaced))
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
@@ -234,15 +234,15 @@ struct AppInfoView: View {
|
|||||||
|
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("/j #channel - join or create a channel")
|
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("/w - see who's online")
|
||||||
Text("/channels - show all discovered channels")
|
Text("/channels - show all discovered channels")
|
||||||
Text("/block @user - block a user")
|
Text("/block @name - block a peer")
|
||||||
Text("/block - list blocked users")
|
Text("/block - list blocked peers")
|
||||||
Text("/unblock @user - unblock a user")
|
Text("/unblock @name - unblock a peer")
|
||||||
Text("/clear - clear current chat")
|
Text("/clear - clear current chat")
|
||||||
Text("/hug @user - send someone a hug")
|
Text("/hug @name - send someone a hug")
|
||||||
Text("/slap @user - slap with a trout")
|
Text("/slap @name - slap with a trout")
|
||||||
}
|
}
|
||||||
.font(.system(size: 14, design: .monospaced))
|
.font(.system(size: 14, design: .monospaced))
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
|
|||||||
@@ -519,12 +519,14 @@ struct ContentView: View {
|
|||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
// Define commands with aliases and syntax
|
// Define commands with aliases and syntax
|
||||||
let commandInfo: [(commands: [String], syntax: String?, description: String)] = [
|
let commandInfo: [(commands: [String], syntax: String?, description: String)] = [
|
||||||
|
(["/block"], "[nickname]", "block or list blocked peers"),
|
||||||
(["/clear"], nil, "clear chat messages"),
|
(["/clear"], nil, "clear chat messages"),
|
||||||
(["/hug"], "<nickname>", "send someone a warm hug"),
|
(["/hug"], "<nickname>", "send someone a warm hug"),
|
||||||
(["/j", "/join"], "<channel>", "join or create a channel"),
|
(["/j", "/join"], "<channel>", "join or create a channel"),
|
||||||
(["/m", "/msg"], "<nickname> [message]", "send private message"),
|
(["/m", "/msg"], "<nickname> [message]", "send private message"),
|
||||||
(["/channels"], nil, "show all discovered channels"),
|
(["/channels"], nil, "show all discovered channels"),
|
||||||
(["/slap"], "<nickname>", "slap someone with a trout"),
|
(["/slap"], "<nickname>", "slap someone with a trout"),
|
||||||
|
(["/unblock"], "<nickname>", "unblock a peer"),
|
||||||
(["/w"], nil, "see who's online")
|
(["/w"], nil, "see who's online")
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -625,14 +627,14 @@ struct ContentView: View {
|
|||||||
if newValue.hasPrefix("/") && newValue.count >= 1 {
|
if newValue.hasPrefix("/") && newValue.count >= 1 {
|
||||||
// Build context-aware command list
|
// Build context-aware command list
|
||||||
var commandDescriptions = [
|
var commandDescriptions = [
|
||||||
("/block", "block or list blocked users"),
|
("/block", "block or list blocked peers"),
|
||||||
|
("/channels", "show all discovered channels"),
|
||||||
("/clear", "clear chat messages"),
|
("/clear", "clear chat messages"),
|
||||||
("/hug", "send someone a warm hug"),
|
("/hug", "send someone a warm hug"),
|
||||||
("/j", "join or create a channel"),
|
("/j", "join or create a channel"),
|
||||||
("/m", "send private message"),
|
("/m", "send private message"),
|
||||||
("/channels", "show all discovered channels"),
|
|
||||||
("/slap", "slap someone with a trout"),
|
("/slap", "slap someone with a trout"),
|
||||||
("/unblock", "unblock a user"),
|
("/unblock", "unblock a peer"),
|
||||||
("/w", "see who's online")
|
("/w", "see who's online")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user