message.go: stripping emoji for when no theme is set

This commit is contained in:
Steven L 2022-07-28 12:29:53 -04:00
parent 68e9d6880d
commit 1102162d1f
1 changed files with 3 additions and 2 deletions

View File

@ -191,10 +191,11 @@ func (m PrivateMsg) From() *User {
}
func (m PrivateMsg) Render(t *Theme) string {
s := fmt.Sprintf("[PM from %s] %s", m.from.Name(), m.body)
format := "[PM from %s] %s"
if t == nil {
return s
return fmt.Sprintf(format, m.from.ID(), m.body)
}
s := fmt.Sprintf(format, m.from.Name(), m.body)
return t.ColorPM(s)
}