Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
added title to indicate link and open mode (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
derricw authored Nov 12, 2020
1 parent 1768df0 commit cc2112d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Here is a list of things that are currently broken.
Here is a list of features I'd like to add soonish.
* Better Attachments Support
* signal-cli seems to delete old attachments after a while. maybe I should move them somewhere where they wont get deleted?
* default color list for contacts instead of white
* better mode indication
* gui configuration
* colors and border styles
* let user re-sort contact list (for example alphabetically)
Expand Down
4 changes: 3 additions & 1 deletion model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ func (m *Message) AddAttachments(paths []string) {
}
}

// Attachment is just a signal.Attachment for now
// Attachment is any file sent or received. Received attachments are left in the usual `signal-cli`
// location for now. It seems to automatically delete old attachments, so we may want to come up
// with a way to keep our own copy somewhere in the siggo data folder.
type Attachment struct {
ContentType string `json:"contentType"`
Filename string `json:"filename"`
Expand Down
7 changes: 7 additions & 0 deletions widgets/chatwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ func (c *ChatWindow) currentConversation() (*model.Conversation, error) {
}
}

func (c *ChatWindow) currentContactName() string {
if c.currentContact != nil {
return c.currentContact.String()
}
return ""
}

// SetCurrentContact sets the active contact
func (c *ChatWindow) SetCurrentContact(contact *model.Contact) error {
log.Debugf("setting current contact to: %v", contact)
Expand Down
2 changes: 2 additions & 0 deletions widgets/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func NewLinksInput(parent *ChatWindow) *LinksInput {
li.SetHighlightFullLine(true)
li.ShowSecondaryText(false)
li.SetBorder(true)
li.SetTitle(fmt.Sprintf("urls: %s", parent.currentContactName()))
li.SetTitleAlign(0)
li.init()
li.SetCurrentItem(-1)

Expand Down
2 changes: 2 additions & 0 deletions widgets/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ func NewOpenInput(parent *ChatWindow) *OpenInput {
oi.SetHighlightFullLine(true)
oi.ShowSecondaryText(false)
oi.SetBorder(true)
oi.SetTitle(fmt.Sprintf("attachments: %s", parent.currentContactName()))
oi.SetTitleAlign(0)
oi.init()
oi.SetCurrentItem(-1)

Expand Down

0 comments on commit cc2112d

Please sign in to comment.