1
0
forked from sunglocto/pi-im

Fix image uploading

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

26
main.go
View File

@@ -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 {