attachments: Add a generated attachment conversation
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user