This commit is contained in:
Tulir Asokan
2018-06-02 00:44:21 +03:00
parent 134604edce
commit b9079e22d2
16 changed files with 28 additions and 28 deletions

View File

@ -22,12 +22,12 @@ import (
"regexp"
"strings"
"golang.org/x/net/html"
"maunium.net/go/gomatrix"
"maunium.net/go/gomuks/matrix/rooms"
"maunium.net/go/gomuks/ui/messages/tstring"
"maunium.net/go/gomuks/ui/widget"
"maunium.net/go/tcell"
"golang.org/x/net/html"
"strconv"
)
@ -68,7 +68,7 @@ func (parser *htmlParser) getAttribute(node *html.Node, attribute string) string
}
func digits(num int) int {
return int(math.Floor(math.Log10(float64(num)))+1)
return int(math.Floor(math.Log10(float64(num))) + 1)
}
func (parser *htmlParser) listToTString(node *html.Node, stripLinebreak bool) tstring.TString {

View File

@ -147,7 +147,7 @@ func getMembershipEventContent(room *rooms.Room, evt *gomatrix.Event) (sender st
text = tstring.NewColorTString(fmt.Sprintf("%s changed their display name to %s.", prevDisplayname, displayname), tcell.ColorGreen)
color := widget.GetHashColor(*evt.StateKey)
text.Colorize(0, len(prevDisplayname), color)
text.Colorize(len(prevDisplayname) + len(" changed their display name to "), len(displayname), color)
text.Colorize(len(prevDisplayname)+len(" changed their display name to "), len(displayname), color)
}
return
}