Fix image uploading

This commit is contained in:
2025-09-03 09:32:24 +01:00
parent ed559c09c4
commit 082d2757f6

24
main.go
View File

@@ -249,13 +249,13 @@ func CreateUITab(chatJidStr string) ChatTabUI {
for i := len(chatTabs[chatJidStr].Messages) - 1; i >= 0; i-- { for i := len(chatTabs[chatJidStr].Messages) - 1; i >= 0; i-- {
if reply.ID == chatTabs[chatJidStr].Messages[i].Raw.StanzaID.ID { if reply.ID == chatTabs[chatJidStr].Messages[i].Raw.StanzaID.ID {
replytext.Show() replytext.Show()
replytext.SetText(fmt.Sprintf(">%s", chatTabs[chatJidStr].Messages[i].Content)) replytext.SetText(fmt.Sprintf("%s", chatTabs[chatJidStr].Messages[i].Content))
guy = chatTabs[chatJidStr].Messages[i].Author guy = chatTabs[chatJidStr].Messages[i].Author
break break
} }
} }
author.SetText(fmt.Sprintf("%s > %s", chatTabs[chatJidStr].Messages[i].Author, guy)) author.SetText(fmt.Sprintf("%s %s", chatTabs[chatJidStr].Messages[i].Author, guy))
} else { } else {
author.SetText(chatTabs[chatJidStr].Messages[i].Author) author.SetText(chatTabs[chatJidStr].Messages[i].Author)
replytext.Hide() replytext.Hide()
@@ -714,14 +714,22 @@ func main() {
dialog.ShowError(err, w) dialog.ShowError(err, w)
} }
return return
} } else {
}, w)
}
err = client.SendText(jid.MustParse(activeMucJid).Bare(), text) err = client.SendText(jid.MustParse(activeMucJid).Bare(), text)
if err != nil { if err != nil {
dialog.ShowError(err, w) dialog.ShowError(err, w)
} }
}
}, w)
} else {
err = client.SendText(jid.MustParse(activeMucJid).Bare(), text)
if err != nil {
dialog.ShowError(err, w)
}
}
}() }()
if !isMuc { if !isMuc {
@@ -1147,14 +1155,14 @@ func main() {
album, al_ok := player.RawMetadata()["xesam:album"] album, al_ok := player.RawMetadata()["xesam:album"]
artists := []string{} artists := []string{}
if a_ok{ if a_ok {
artist.Store(&artists) artist.Store(&artists)
} }
if t_ok && a_ok && al_ok && album.String() != "\"\""{ if t_ok && a_ok && al_ok && album.String() != "\"\"" {
newtext = fmt.Sprintf("I'm currently listening to %s by %s, in the %s album", strings.Trim(title.String(), "\""), strings.Join(artists, ","), album) newtext = fmt.Sprintf("I'm currently listening to %s by %s, in the %s album", strings.Trim(title.String(), "\""), strings.Join(artists, ","), album)
} else if t_ok && a_ok { } else if t_ok && a_ok {
newtext = fmt.Sprintf("I'm currently listening to %s by %s", strings.Trim(title.String(), "\""), strings.Join(artists, ",") ) newtext = fmt.Sprintf("I'm currently listening to %s by %s", strings.Trim(title.String(), "\""), strings.Join(artists, ","))
} else if t_ok { } else if t_ok {
newtext = fmt.Sprintf("I'm currently listening to %s", strings.Trim(title.String(), "\"")) newtext = fmt.Sprintf("I'm currently listening to %s", strings.Trim(title.String(), "\""))
} else if a_ok { } else if a_ok {