mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-08-25 15:11:15 +00:00
feat: rename chat-cli's /intro command to /account
This commit is contained in:
@@ -54,8 +54,8 @@ cargo run -p chat-cli -- --name bob --transport file
|
||||
|
||||
### Establishing a connection
|
||||
|
||||
1. In Alice's terminal, type `/intro` — the bundle is copied to your clipboard automatically.
|
||||
2. In Bob's terminal, type `/connect <paste bundle here>`.
|
||||
1. In Alice's terminal, type `/account` — her address is copied to the clipboard automatically.
|
||||
2. In Bob's terminal, type `/connect <paste address here>`.
|
||||
3. Bob's "Hello!" message appears in Alice's terminal. Both can now chat.
|
||||
|
||||
### Optional: KeyPackage registry
|
||||
@@ -97,8 +97,8 @@ The registry is a throwaway testnet helper; v0.3 replaces it with a
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/help` | Show available commands |
|
||||
| `/intro` | Generate your introduction bundle (copies to clipboard) |
|
||||
| `/connect <bundle>` | Connect to a user using their introduction bundle |
|
||||
| `/account` | Show your account address (copies to clipboard) |
|
||||
| `/connect <address>` | Connect to a user using their address |
|
||||
| `/chats` | List all established chats |
|
||||
| `/switch <user>` | Switch active chat |
|
||||
| `/delete <user>` | Delete a chat session |
|
||||
|
||||
@@ -241,7 +241,7 @@ where
|
||||
match command {
|
||||
"/help" => {
|
||||
self.add_system_message("── Commands ──");
|
||||
self.add_system_message("/intro - Show your address");
|
||||
self.add_system_message("/account - Show your account address");
|
||||
self.add_system_message("/connect <address> - Connect using an address");
|
||||
self.add_system_message("/nickname <name> - Name the active chat");
|
||||
self.add_system_message("/chats - List all chats");
|
||||
@@ -252,17 +252,17 @@ where
|
||||
self.add_system_message("/quit or Esc or Ctrl+C - Exit");
|
||||
Ok(Some("Help displayed".to_string()))
|
||||
}
|
||||
"/intro" => {
|
||||
"/account" => {
|
||||
let address = self.client.addr().to_string();
|
||||
self.add_system_message("── Your Address ──");
|
||||
self.add_system_message("── Your Account Address ──");
|
||||
self.add_system_message(&address);
|
||||
let clipboard_msg = match Clipboard::new().and_then(|mut cb| cb.set_text(&address))
|
||||
{
|
||||
Ok(()) => "Address copied to clipboard! Share it, then /connect their address.",
|
||||
Err(_) => "Share this address with others to connect!",
|
||||
Ok(()) => "Address copied to clipboard. Share it so others can reach you.",
|
||||
Err(_) => "Share this address so others can reach you.",
|
||||
};
|
||||
self.add_system_message(clipboard_msg);
|
||||
Ok(Some("Address shown".to_string()))
|
||||
Ok(Some("Account address shown".to_string()))
|
||||
}
|
||||
"/connect" => {
|
||||
if args.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user