From 082d2757f60a4e9de27c5ad3bf5c55edc6ace604 Mon Sep 17 00:00:00 2001 From: sunglocto Date: Wed, 3 Sep 2025 09:32:24 +0100 Subject: [PATCH] Fix image uploading --- main.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index e3e78fc..80aa4e9 100644 --- a/main.go +++ b/main.go @@ -249,13 +249,13 @@ func CreateUITab(chatJidStr string) ChatTabUI { for i := len(chatTabs[chatJidStr].Messages) - 1; i >= 0; i-- { if reply.ID == chatTabs[chatJidStr].Messages[i].Raw.StanzaID.ID { 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 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 { author.SetText(chatTabs[chatJidStr].Messages[i].Author) replytext.Hide() @@ -714,13 +714,21 @@ func main() { dialog.ShowError(err, w) } return + } else { + err = client.SendText(jid.MustParse(activeMucJid).Bare(), text) + + if err != nil { + dialog.ShowError(err, w) + } + } }, w) - } - err = client.SendText(jid.MustParse(activeMucJid).Bare(), text) + } else { + err = client.SendText(jid.MustParse(activeMucJid).Bare(), text) - if err != nil { - dialog.ShowError(err, w) + if err != nil { + dialog.ShowError(err, w) + } } }() @@ -1147,14 +1155,14 @@ func main() { album, al_ok := player.RawMetadata()["xesam:album"] artists := []string{} - if a_ok{ + if a_ok { 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) } 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 { newtext = fmt.Sprintf("I'm currently listening to %s", strings.Trim(title.String(), "\"")) } else if a_ok {