checkpoint: print media attachments in timeline view
This commit is contained in:
parent
56445601a3
commit
0e26b65a54
2 changed files with 13 additions and 1 deletions
|
@ -39,6 +39,7 @@ type Printer struct {
|
|||
failureSymbol string
|
||||
dateFormat string
|
||||
dateTimeFormat string
|
||||
imageIcon string
|
||||
}
|
||||
|
||||
func NewPrinter(
|
||||
|
@ -62,6 +63,7 @@ func NewPrinter(
|
|||
}
|
||||
|
||||
return &Printer{
|
||||
theme: theme,
|
||||
noColor: noColor,
|
||||
maxTerminalWidth: maxTerminalWidth,
|
||||
pager: pager,
|
||||
|
@ -72,7 +74,7 @@ func NewPrinter(
|
|||
failureSymbol: "\u2717",
|
||||
dateFormat: "02 Jan 2006",
|
||||
dateTimeFormat: "02 Jan 2006, 15:04 (MST)",
|
||||
theme: theme,
|
||||
imageIcon: "\uf03e",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,16 @@ func (p Printer) PrintStatusList(list model.StatusList) {
|
|||
builder.WriteString(p.pollOptions(*status.Poll))
|
||||
}
|
||||
|
||||
for _, media := range status.MediaAttachments {
|
||||
builder.WriteString("\n\n" + p.imageIcon + " Media (" + media.ID + ")" + "\n ")
|
||||
|
||||
if media.Description == "" {
|
||||
builder.WriteString("This media has no description.")
|
||||
} else {
|
||||
builder.WriteString(utilities.WrapLines(media.Description, "\n ", p.maxTerminalWidth-3))
|
||||
}
|
||||
}
|
||||
|
||||
builder.WriteString(
|
||||
"\n\n" +
|
||||
p.fieldFormat("Status ID:") + " " + statusID + "\t" +
|
||||
|
|
Loading…
Reference in a new issue