diff options
Diffstat (limited to 'internal/web')
-rw-r--r-- | internal/web/opengraph.go | 7 | ||||
-rw-r--r-- | internal/web/thread.go | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/web/opengraph.go b/internal/web/opengraph.go index 188e2b8a1..66b6c6eea 100644 --- a/internal/web/opengraph.go +++ b/internal/web/opengraph.go @@ -123,9 +123,14 @@ func (og *ogMeta) withStatus(status *apimodel.Status) *ogMeta { if !status.Sensitive && len(status.MediaAttachments) > 0 { a := status.MediaAttachments[0] - og.Image = a.PreviewURL + og.ImageWidth = strconv.Itoa(a.Meta.Small.Width) og.ImageHeight = strconv.Itoa(a.Meta.Small.Height) + + if a.PreviewURL != nil { + og.Image = *a.PreviewURL + } + if a.Description != nil { og.ImageAlt = *a.Description } diff --git a/internal/web/thread.go b/internal/web/thread.go index d2ae29c07..13dd5877d 100644 --- a/internal/web/thread.go +++ b/internal/web/thread.go @@ -125,7 +125,7 @@ func (m *Module) threadGETHandler(c *gin.Context) { } // Fill in the rest of the thread context. - context, errWithCode := m.processor.Status().ContextGet(ctx, authed.Account, targetStatusID) + context, errWithCode := m.processor.Status().WebContextGet(ctx, targetStatusID) if errWithCode != nil { apiutil.WebErrorHandler(c, errWithCode, instanceGet) return |