From e4d5f5b940fa764708f4655a42c40d382ed79bc1 Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 8 Jul 2025 02:47:04 +0200 Subject: [PATCH] Add block command to autocomplete, app info modal, and README --- README.md | 3 +++ bitchat/Views/AppInfoView.swift | 40 +++++++++++++++++++++++++++++++++ bitchat/Views/ContentView.swift | 2 ++ 3 files changed, 45 insertions(+) diff --git a/README.md b/README.md index a4c86560..2037e37e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ This project is released into the public domain. See the [LICENSE](LICENSE) file - `/m @user 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 - `/clear` - Clear chat messages - `/pass [password]` - Set/change channel password (owner only) - `/transfer @user` - Transfer channel ownership diff --git a/bitchat/Views/AppInfoView.swift b/bitchat/Views/AppInfoView.swift index f6ca27b1..53f613b2 100644 --- a/bitchat/Views/AppInfoView.swift +++ b/bitchat/Views/AppInfoView.swift @@ -102,6 +102,26 @@ struct AppInfoView: View { .foregroundColor(textColor) } + // Commands + VStack(alignment: .leading, spacing: 16) { + SectionHeader("Commands") + + VStack(alignment: .leading, spacing: 8) { + Text("/j #channel - join or create a channel") + Text("/m @user - 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("/clear - clear current chat") + Text("/hug @user - send someone a hug") + Text("/slap @user - slap with a trout") + } + .font(.system(size: 14, design: .monospaced)) + .foregroundColor(textColor) + } + // Technical Details VStack(alignment: .leading, spacing: 16) { SectionHeader("Technical Details") @@ -208,6 +228,26 @@ struct AppInfoView: View { .foregroundColor(textColor) } + // Commands + VStack(alignment: .leading, spacing: 16) { + SectionHeader("Commands") + + VStack(alignment: .leading, spacing: 8) { + Text("/j #channel - join or create a channel") + Text("/m @user - 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("/clear - clear current chat") + Text("/hug @user - send someone a hug") + Text("/slap @user - slap with a trout") + } + .font(.system(size: 14, design: .monospaced)) + .foregroundColor(textColor) + } + // Technical Details VStack(alignment: .leading, spacing: 16) { SectionHeader("Technical Details") diff --git a/bitchat/Views/ContentView.swift b/bitchat/Views/ContentView.swift index 67238079..43d1a7c6 100644 --- a/bitchat/Views/ContentView.swift +++ b/bitchat/Views/ContentView.swift @@ -625,12 +625,14 @@ struct ContentView: View { if newValue.hasPrefix("/") && newValue.count >= 1 { // Build context-aware command list var commandDescriptions = [ + ("/block", "block or list blocked users"), ("/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"), ("/w", "see who's online") ]