somehow sunglocto returned

This commit is contained in:
2026-04-26 10:40:13 +01:00
parent 69994d9856
commit fc0ed5ac2c
13 changed files with 407 additions and 68 deletions
+24
View File
@@ -248,6 +248,30 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
mainBox.Append(subjectlabel)
}
link_preview := LinkPreview{}
ok = m.Get(&link_preview)
if ok {
lp_box := gtk.NewBox(gtk.OrientationVertical, 10)
lp_box.AddCSSClass("link_preview")
lp_title := gtk.NewLabel(link_preview.Title)
lp_title.SetSelectable(true)
lp_title.SetWrap(true)
lp_title.SetHAlign(gtk.AlignFill)
lp_desc := gtk.NewLabel(link_preview.URL + "\n" + link_preview.Description)
lp_desc.SetSelectable(true)
lp_desc.SetWrap(true)
lp_desc.SetHAlign(gtk.AlignFill)
lp_box.Append(lp_title)
lp_box.Append(lp_desc)
warning := gtk.NewLabel("⚠️")
warning.SetTooltipText("This link preview was generated by the client sending it and may not be accurate of the actual website content")
lp_box.Append(warning)
mainBox.Append(lp_box)
}
return mainBox
}