Private
Public Access
1
0

attachments: Add a generated attachment conversation

This commit is contained in:
2024-04-07 21:06:03 -07:00
parent fa76c7eac1
commit a1349eff1b
7 changed files with 69 additions and 13 deletions

View File

@@ -20,8 +20,13 @@ type Prompt struct {
func (p *Prompt) conversationForGUID(guid string) (*model.Conversation, error) {
if guid == "*" {
// This means any conversation: return the first one
return &p.server.SortedConversations()[0], nil
// This means any conversation: return the first one (that's not the special Attachments convo)
convo := p.server.SortedConversations()[0]
if *convo.DisplayName == server.ATTACHMENT_CONVO_DISP_NAME {
return &p.server.SortedConversations()[1], nil
}
return &convo, nil
}
return p.server.ConversationForGUID(guid)
@@ -196,7 +201,9 @@ func (p *Prompt) StartInteractive() error {
return nil
default:
fmt.Printf("Unknown command: %s\n", line)
if len(line) > 0 {
fmt.Printf("Unknown command: %s\n", line)
}
}
}