From 755f2697177dc07cabe35ab6958559b7d0804cc1 Mon Sep 17 00:00:00 2001 From: Marcel Schramm Date: Fri, 29 Nov 2019 20:43:54 +0100 Subject: [PATCH] Fixes #221 --- ui/usertree.go | 4 +++- ui/window.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/usertree.go b/ui/usertree.go index 7c8cb487..2c489eaf 100644 --- a/ui/usertree.go +++ b/ui/usertree.go @@ -5,6 +5,8 @@ import ( "github.com/Bios-Marcel/cordless/config" "github.com/Bios-Marcel/cordless/discordutil" + "github.com/Bios-Marcel/cordless/ui/tviewutil" + "github.com/Bios-Marcel/discordgo" "github.com/Bios-Marcel/tview" "github.com/gdamore/tcell" @@ -128,7 +130,7 @@ func (userTree *UserTree) loadGuildRoles(guildID string) ([]*discordgo.Role, err for _, role := range guildRoles { if role.Hoist { - roleNode := tview.NewTreeNode(role.Name) + roleNode := tview.NewTreeNode(tviewutil.Escape(role.Name)) roleNode.SetSelectable(false) userTree.roleNodes[role.ID] = roleNode userTree.rootNode.AddChild(roleNode) diff --git a/ui/window.go b/ui/window.go index ee690765..b397be1b 100644 --- a/ui/window.go +++ b/ui/window.go @@ -1038,7 +1038,7 @@ func NewWindow(doRestart chan bool, app *tview.Application, session *discordgo.S bottomBar := tview.NewFlex().SetDirection(tview.FlexColumn) bottomBar.SetBackgroundColor(config.GetTheme().PrimitiveBackgroundColor) - loggedInAsText := fmt.Sprintf("Logged in as: '%s'", session.State.User.String()) + loggedInAsText := fmt.Sprintf("Logged in as: '%s'", tviewutil.Escape(session.State.User.String())) loggedInAs := tview.NewTextView().SetText(loggedInAsText) loggedInAs.SetTextColor(config.GetTheme().PrimitiveBackgroundColor).SetBackgroundColor(config.GetTheme().PrimaryTextColor) bottomBar.AddItem(loggedInAs, runewidth.StringWidth(loggedInAsText), 0, false)