fix: view media attachments from reposted statuses

In the timeline view, you should now be able to see the content, poll
and media attachments from statuses that have been reposted (boosted).
This commit is contained in:
Dan Anglin 2024-06-19 01:36:32 +01:00
parent e8114f8d22
commit 96ad6a7b55
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
2 changed files with 11 additions and 5 deletions

View file

@ -82,7 +82,7 @@ type StatusReblogged struct {
Mentions []Mention `json:"mentions"`
Muted bool `json:"muted"`
Pinned bool `json:"pinned"`
Poll Poll `json:"poll"`
Poll *Poll `json:"poll"`
Reblogged bool `json:"reblogged"`
RebloggsCount int `json:"reblogs_count"`
RepliesCount int `json:"replies_count"`

View file

@ -81,6 +81,9 @@ func (p Printer) PrintStatusList(list model.StatusList) {
statusID := status.ID
createdAt := status.CreatedAt
content := status.Content
poll := status.Poll
mediaAttachments := status.MediaAttachments
if status.Reblog != nil {
builder.WriteString(
@ -89,15 +92,18 @@ func (p Printer) PrintStatusList(list model.StatusList) {
statusID = status.Reblog.ID
createdAt = status.Reblog.CreatedAt
content = status.Reblog.Content
poll = status.Reblog.Poll
mediaAttachments = status.Reblog.MediaAttachments
}
builder.WriteString("\n" + utilities.WrapLines(utilities.ConvertHTMLToText(status.Content), "\n", p.maxTerminalWidth))
builder.WriteString("\n" + utilities.WrapLines(utilities.ConvertHTMLToText(content), "\n", p.maxTerminalWidth))
if status.Poll != nil {
builder.WriteString(p.pollOptions(*status.Poll))
if poll != nil {
builder.WriteString(p.pollOptions(*poll))
}
for _, media := range status.MediaAttachments {
for _, media := range mediaAttachments {
builder.WriteString("\n\n" + p.imageIcon + " Media (" + media.ID + ")" + "\n ")
description := media.Description