Documentation
¶
Index ¶
- Constants
- func AttachFromClipboard(parent *ChatWindow) error
- func CompletePath(path string) string
- func FZFFile() (string, error)
- func FZFList(items []string) (string, error)
- func FancyCompose() (string, error)
- func GetSharedPrefix(s ...string) string
- type ChatWindow
- func (c *ChatWindow) Compose()
- func (c *ChatWindow) ContactDown()
- func (c *ChatWindow) ContactUp()
- func (c *ChatWindow) FancyAttach()
- func (c *ChatWindow) FocusMe()
- func (c *ChatWindow) FuzzyGoTo()
- func (c *ChatWindow) HideCommandInput()
- func (c *ChatWindow) HideConversation(replacement tview.Primitive)
- func (c *ChatWindow) HideStatusBar()
- func (c *ChatWindow) InsertMode()
- func (c *ChatWindow) LinkMode()
- func (c *ChatWindow) NextUnreadMessage() error
- func (c *ChatWindow) NormalMode()
- func (c *ChatWindow) OpenMode()
- func (c *ChatWindow) Paste() error
- func (c *ChatWindow) Quit()
- func (c *ChatWindow) SetCurrentContact(contact *model.Contact) error
- func (c *ChatWindow) SetCurrentContactByString(contactName string) error
- func (c *ChatWindow) SetErrorStatus(err error)
- func (c *ChatWindow) SetStatus(statusMsg string)
- func (c *ChatWindow) ShowAttachInput()
- func (c *ChatWindow) ShowConversation()
- func (c *ChatWindow) ShowFilterInput()
- func (c *ChatWindow) ShowStatusBar()
- func (c *ChatWindow) ShowTempSentMsg(msg string)
- func (c *ChatWindow) YankLastLink()
- func (c *ChatWindow) YankLastMsg()
- func (c *ChatWindow) YankMode()
- type CommandInput
- type ContactListPanel
- type ConversationPanel
- type LinksInput
- type Mode
- type OpenInput
- type SendPanel
- type StatusBar
Constants ¶
const DraftMarker = "~"
Variables ¶
This section is empty.
Functions ¶
func AttachFromClipboard ¶
func AttachFromClipboard(parent *ChatWindow) error
AttachFromClipboard attaches a file directly from clipboard. Text is just pasted into the message.
func FancyCompose ¶
FancyCompose opens up EDITOR and composes a big fancy message.
func GetSharedPrefix ¶
GetSharedPrefix finds the prefix shared by any number of strings Is there a more efficient way to do this?
Types ¶
type ChatWindow ¶
type ChatWindow struct { // todo: maybe use Flex instead of Grid? *tview.Grid // contains filtered or unexported fields }
ChatWindow is the main panel for the UI.
func NewChatWindow ¶
func NewChatWindow(siggo *model.Siggo, app *tview.Application) *ChatWindow
func (*ChatWindow) Compose ¶
func (c *ChatWindow) Compose()
Compose opens an EDITOR to compose a command. If any text is saved in the buffer, we send it as a message to the current conversation.
func (*ChatWindow) ContactDown ¶
func (c *ChatWindow) ContactDown()
func (*ChatWindow) ContactUp ¶
func (c *ChatWindow) ContactUp()
TODO: remove code duplication with ContactDown()
func (*ChatWindow) FancyAttach ¶
func (c *ChatWindow) FancyAttach()
FancyAttach opens FZF and selects a file to attach
func (*ChatWindow) FuzzyGoTo ¶
func (c *ChatWindow) FuzzyGoTo()
FuzzyGoTo goes to a contact or group with fuzzy matching
func (*ChatWindow) HideCommandInput ¶
func (c *ChatWindow) HideCommandInput()
HideCommandInput hides any current CommandInput panel
func (*ChatWindow) HideConversation ¶
func (c *ChatWindow) HideConversation(replacement tview.Primitive)
HideConversation temporarily replaces the conversation panel with another widget
func (*ChatWindow) HideStatusBar ¶
func (c *ChatWindow) HideStatusBar()
HideStatusBar stops showing the status bar
func (*ChatWindow) NextUnreadMessage ¶
func (c *ChatWindow) NextUnreadMessage() error
NextUnreadMessage searches for the next conversation with unread messages and makes that the active conversation.
func (*ChatWindow) OpenMode ¶
func (c *ChatWindow) OpenMode()
OpenMode enters open mode which lets us select an attachment to open
func (*ChatWindow) Paste ¶
func (c *ChatWindow) Paste() error
func (*ChatWindow) SetCurrentContact ¶
func (c *ChatWindow) SetCurrentContact(contact *model.Contact) error
SetCurrentContact sets the active contact
func (*ChatWindow) SetCurrentContactByString ¶
func (c *ChatWindow) SetCurrentContactByString(contactName string) error
SetCurrentContactByString sets the active contact to the first contact whose string representation matches
func (*ChatWindow) SetErrorStatus ¶
func (c *ChatWindow) SetErrorStatus(err error)
SetErrorStatus shows an error status in the status bar
func (*ChatWindow) SetStatus ¶
func (c *ChatWindow) SetStatus(statusMsg string)
SetStatus shows a status message on the status bar
func (*ChatWindow) ShowAttachInput ¶
func (c *ChatWindow) ShowAttachInput()
ShowAttachInput opens a commandPanel to choose a file to attach
func (*ChatWindow) ShowConversation ¶
func (c *ChatWindow) ShowConversation()
ShowConversation ensures that the conversation panel is showing. This should be called when any widget is done hiding the conversation panel
func (*ChatWindow) ShowFilterInput ¶
func (c *ChatWindow) ShowFilterInput()
ShowFilterInput opens a commandPanel to filter the conversation
func (*ChatWindow) ShowStatusBar ¶
func (c *ChatWindow) ShowStatusBar()
ShowStatusBar shows the bottom status bar
func (*ChatWindow) ShowTempSentMsg ¶
func (c *ChatWindow) ShowTempSentMsg(msg string)
ShowTempSentMsg shows a temporary message when a message is sent but before delivery. Only displayed for the second or two after a message is sent.
func (*ChatWindow) YankLastLink ¶
func (c *ChatWindow) YankLastLink()
YankLastLink copies the last link in a converstaion to the clipboard
func (*ChatWindow) YankLastMsg ¶
func (c *ChatWindow) YankLastMsg()
YankLastMsg copies the last message of a conversation to the clipboard.
type CommandInput ¶
type CommandInput struct { *tview.InputField // contains filtered or unexported fields }
CommandInput is an input field that appears at the bottom of the window and allows for various commands
func NewAttachInput ¶
func NewAttachInput(parent *ChatWindow) *CommandInput
NewAttachInput is a command input that selects an attachment and attaches it to the current conversation to be sent in the next message.
func NewFilterInput ¶
func NewFilterInput(parent *ChatWindow) *CommandInput
NewFilterInput is a command input that lets you filter the current conversation
type ContactListPanel ¶
func NewContactListPanel ¶
func NewContactListPanel(parent *ChatWindow, siggo *model.Siggo) *ContactListPanel
NewContactListPanel creates a new contact list widget
func (*ContactListPanel) GotoContact ¶
func (cl *ContactListPanel) GotoContact(contact *model.Contact)
GotoContact goes to a particular contact. TODO: constant time way to do this?
func (*ContactListPanel) GotoIndex ¶
func (cl *ContactListPanel) GotoIndex(index int) *model.Contact
GotoIndex goes to a particular contact index and return the Contact. Negative indexing is allowed.
func (*ContactListPanel) Next ¶
func (cl *ContactListPanel) Next() *model.Contact
func (*ContactListPanel) Previous ¶
func (cl *ContactListPanel) Previous() *model.Contact
type ConversationPanel ¶
func NewConversationPanel ¶
func NewConversationPanel(siggo *model.Siggo) *ConversationPanel
func (*ConversationPanel) Clear ¶
func (p *ConversationPanel) Clear()
func (*ConversationPanel) Filter ¶
func (p *ConversationPanel) Filter(s string)
func (*ConversationPanel) Update ¶
func (p *ConversationPanel) Update(conv *model.Conversation)
type LinksInput ¶
LinksInput is a widget that allows us to select from links in the conversation
func NewLinksInput ¶
func NewLinksInput(parent *ChatWindow) *LinksInput
func (*LinksInput) Close ¶
func (li *LinksInput) Close()
func (*LinksInput) Next ¶
func (li *LinksInput) Next()
func (*LinksInput) OpenSelected ¶
func (li *LinksInput) OpenSelected()
OpenSelected opens whichever link is selected
func (*LinksInput) Previous ¶
func (li *LinksInput) Previous()
func (*LinksInput) YankSelected ¶
func (li *LinksInput) YankSelected()
YankSelected copies copies the currently selected link to the clipboard
type OpenInput ¶
OpenInput is a widget that allows us to select an attachment to open.
func NewOpenInput ¶
func NewOpenInput(parent *ChatWindow) *OpenInput
func (*OpenInput) OpenAttachment ¶
func (oi *OpenInput) OpenAttachment(attachment *model.Attachment)
OpenAttachment opens a `*signal.Attachment`
func (*OpenInput) OpenLast ¶
func (oi *OpenInput) OpenLast()
OpenLastAttachment opens the last attachment that it finds in the conversation
func (*OpenInput) OpenSelected ¶
func (oi *OpenInput) OpenSelected()
OpenSelected opens whichever attachment is selected
type SendPanel ¶
type SendPanel struct { *tview.InputField // contains filtered or unexported fields }
func NewSendPanel ¶
func NewSendPanel(parent *ChatWindow, siggo *model.Siggo) *SendPanel
NewSendPanel creates a new SendPanel that is primarily a tview.InputField
type StatusBar ¶
func NewStatusBar ¶
func NewStatusBar(parent *ChatWindow) *StatusBar