forked from sunglocto/pi-im
Convert newlines to symbol in reply text
This commit is contained in:
5
main.go
5
main.go
@@ -40,6 +40,7 @@ var chatInfo fyne.Container
|
||||
var chatSidebar fyne.Container
|
||||
var replyNameIcon string = ">"
|
||||
var replyBodyIcon string = ">"
|
||||
var newlineIcon string = "|->"
|
||||
var agreesToSendingHotFuckIntoChannel bool = false
|
||||
|
||||
// by sunglocto
|
||||
@@ -260,7 +261,7 @@ 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 %s", replyBodyIcon, chatTabs[chatJidStr].Messages[i].Content))
|
||||
replytext.SetText(fmt.Sprintf("%s %s", replyBodyIcon, strings.ReplaceAll(chatTabs[chatJidStr].Messages[i].Content, "\n", newlineIcon)))
|
||||
guy = chatTabs[chatJidStr].Messages[i].Author
|
||||
break
|
||||
}
|
||||
@@ -436,6 +437,7 @@ func main() {
|
||||
if isUTF8Locale() {
|
||||
replyBodyIcon = "↱"
|
||||
replyNameIcon = "→ "
|
||||
newlineIcon = " ⮡ "
|
||||
}
|
||||
|
||||
client, err := oasisSdk.CreateClient(
|
||||
@@ -596,6 +598,7 @@ func main() {
|
||||
if !ignore {
|
||||
tab.Messages = append(tab.Messages, myMessage)
|
||||
}
|
||||
important = false
|
||||
fyne.Do(func() {
|
||||
UITabs[mucJidStr].Scroller.Refresh()
|
||||
if scrollDownOnNewMessage {
|
||||
|
Reference in New Issue
Block a user