mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-18 17:57:41 +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) {
|
switch m := m.(type) {
|
||||||
case PublicMsg:
|
case PublicMsg:
|
||||||
if u == m.From() {
|
if u == m.From() {
|
||||||
|
if !cfg.Echo {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
out += m.RenderSelf(cfg)
|
out += m.RenderSelf(cfg)
|
||||||
} else {
|
} else {
|
||||||
out += m.RenderFor(cfg)
|
out += m.RenderFor(cfg)
|
||||||
@ -226,6 +229,7 @@ type UserConfig struct {
|
|||||||
Highlight *regexp.Regexp
|
Highlight *regexp.Regexp
|
||||||
Bell bool
|
Bell bool
|
||||||
Quiet bool
|
Quiet bool
|
||||||
|
Echo bool // Echo shows your own messages after sending, disabled for bots
|
||||||
Timeformat *string
|
Timeformat *string
|
||||||
Timezone *time.Location
|
Timezone *time.Location
|
||||||
Theme *Theme
|
Theme *Theme
|
||||||
@ -237,6 +241,7 @@ var DefaultUserConfig UserConfig
|
|||||||
func init() {
|
func init() {
|
||||||
DefaultUserConfig = UserConfig{
|
DefaultUserConfig = UserConfig{
|
||||||
Bell: true,
|
Bell: true,
|
||||||
|
Echo: true,
|
||||||
Quiet: false,
|
Quiet: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user