Skip to content

Commit

Permalink
Render emoji and markdown in private messages
Browse files Browse the repository at this point in the history
  • Loading branch information
purplesyringa committed Jan 1, 2023
1 parent 7303407 commit db136df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions chat/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ func (m PrivateMsg) Render(t *Theme) string {
return renderMessageFor("[PM from ", m.from, "] ", m.body, t, nil, true)
}

func (m PrivateMsg) RenderFor(cfg UserConfig) string {
return renderMessageFor("[PM from ", m.from, "] ", m.body, cfg.Theme, &cfg, true)
}

func (m PrivateMsg) String() string {
return m.Render(nil)
}
Expand Down
2 changes: 1 addition & 1 deletion chat/message/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (u *User) render(m Message) string {
out += m.RenderFor(cfg)
}
case *PrivateMsg:
out += m.Render(cfg.Theme)
out += m.RenderFor(cfg)
if cfg.Bell {
out += Bel
}
Expand Down

0 comments on commit db136df

Please sign in to comment.