diff --git a/cmd/messages_text.go b/cmd/messages_text.go index 6436208..b9d0cef 100644 --- a/cmd/messages_text.go +++ b/cmd/messages_text.go @@ -160,7 +160,11 @@ func (mt *MessagesText) createBody(w io.Writer, m discord.Message, isReply bool) func (mt *MessagesText) createFooter(w io.Writer, m discord.Message) { for _, a := range m.Attachments { fmt.Fprintln(w) - fmt.Fprintf(w, "[%s]: %s", a.Filename, a.URL) + if cfg.ShowAttachmentLinks { + fmt.Fprintf(w, "[%s][%s]:\n%s[-]", cfg.Theme.MessagesText.AttachmentColor, a.Filename, a.URL) + } else { + fmt.Fprintf(w, "[%s][%s][-]", cfg.Theme.MessagesText.AttachmentColor, a.Filename) + } } } diff --git a/internal/config/config.go b/internal/config/config.go index 70132d3..7bf92c4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -20,6 +20,8 @@ type Config struct { TimestampsBeforeAuthor bool `toml:"timestamps_before_author"` TimestampsFormat string `toml:"timestamps_format"` + ShowAttachmentLinks bool `toml:"show_attachment_links"` + Keys Keys `toml:"keys"` Theme Theme `toml:"theme"` } @@ -34,6 +36,8 @@ func defaultConfig() *Config { Timestamps: false, TimestampsBeforeAuthor: false, TimestampsFormat: time.Kitchen, + + ShowAttachmentLinks: true, Keys: defaultKeys(), Theme: defaultTheme(), diff --git a/internal/config/theme.go b/internal/config/theme.go index 51418e6..f665fe7 100644 --- a/internal/config/theme.go +++ b/internal/config/theme.go @@ -26,10 +26,11 @@ type ( MessagesTextTheme struct { ReplyIndicator string `toml:"reply_indicator"` - AuthorColor string `toml:"author_color"` - ContentColor string `toml:"content_color"` - EmojiColor string `toml:"emoji_color"` - LinkColor string `toml:"link_color"` + AuthorColor string `toml:"author_color"` + ContentColor string `toml:"content_color"` + EmojiColor string `toml:"emoji_color"` + LinkColor string `toml:"link_color"` + AttachmentColor string `toml:"attachment_color"` } ) @@ -52,10 +53,11 @@ func defaultTheme() Theme { MessagesText: MessagesTextTheme{ ReplyIndicator: string(tview.BoxDrawingsLightArcDownAndRight) + " ", - AuthorColor: "aqua", - ContentColor: tview.Styles.PrimaryTextColor.String(), - EmojiColor: "green", - LinkColor: "blue", + AuthorColor: "aqua", + ContentColor: tview.Styles.PrimaryTextColor.String(), + EmojiColor: "green", + LinkColor: "blue", + AttachmentColor: "yellow", }, } }