add more support for other message types

This commit is contained in:
2026-02-03 10:07:33 +00:00
parent 971147dcb8
commit c260b8b231
4 changed files with 38 additions and 3 deletions

View File

@@ -49,7 +49,27 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
readmarker := Marker{}
ok = m.Get(&readmarker)
if ok {
return gtk.NewLabel(fmt.Sprintf("%s has read to this point", JidMustParse(m.From).Resource))
b := gtk.NewBox(gtk.OrientationHorizontal, 0)
b.Append(gtk.NewLabel(fmt.Sprintf("%s has read to this point", JidMustParse(m.From).Resource)))
return b
}
indicator := stanza.StateComposing{}
ok = m.Get(&indicator)
if ok { // TODO: Display typing indicator in a stat bar or something similar
b := gtk.NewBox(gtk.OrientationHorizontal, 0)
b.Append(gtk.NewLabel(fmt.Sprintf("%s is typing...", JidMustParse(m.From).Resource)))
return b
}
if m.Error.Type != "" {
error_box := gtk.NewBox(gtk.OrientationHorizontal, 0)
cancel_img := gtk.NewImageFromPaintable(clientAssets["cancel"])
error_label := gtk.NewLabel(m.Error.Text)
error_box.Append(cancel_img)
error_box.Append(error_label)
return error_box
}