Merge pull request #416 from sleibrock/master

Fixing emojis being sent in PMs when no theme is set (#414)
This commit is contained in:
Andrey Petrov 2022-07-31 10:08:56 -04:00 committed by GitHub
commit 748fc819e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}