mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-15 00:20:37 +03:00
chat/message: Add UserConfig.Echo
This commit is contained in:
parent
c0f9814ae1
commit
2076980aea
@ -161,6 +161,9 @@ func (u *User) render(m Message) string {
|
||||
switch m := m.(type) {
|
||||
case PublicMsg:
|
||||
if u == m.From() {
|
||||
if !cfg.Echo {
|
||||
return ""
|
||||
}
|
||||
out += m.RenderSelf(cfg)
|
||||
} else {
|
||||
out += m.RenderFor(cfg)
|
||||
@ -226,6 +229,7 @@ type UserConfig struct {
|
||||
Highlight *regexp.Regexp
|
||||
Bell bool
|
||||
Quiet bool
|
||||
Echo bool // Echo shows your own messages after sending, disabled for bots
|
||||
Timeformat *string
|
||||
Timezone *time.Location
|
||||
Theme *Theme
|
||||
@ -237,6 +241,7 @@ var DefaultUserConfig UserConfig
|
||||
func init() {
|
||||
DefaultUserConfig = UserConfig{
|
||||
Bell: true,
|
||||
Echo: true,
|
||||
Quiet: false,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user