aboutsummaryrefslogtreecommitdiff
path: root/hotline/client.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-12-01 14:11:38 -0800
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-12-01 14:11:38 -0800
commit89bbc565e6838c868fb365c75023856806eaa218 (patch)
treef77ef4f1f407e4721cdedf7e324d00aef4cc8607 /hotline/client.go
parente2de9d02db38ff188fea569a5b98071a6bd403ea (diff)
Add option to trigger terminal bell for chat messages
Diffstat (limited to 'hotline/client.go')
-rw-r--r--hotline/client.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/hotline/client.go b/hotline/client.go
index 83bcfab..c7c1463 100644
--- a/hotline/client.go
+++ b/hotline/client.go
@@ -35,10 +35,11 @@ type Bookmark struct {
}
type ClientPrefs struct {
- Username string `yaml:"Username"`
- IconID int `yaml:"IconID"`
- Bookmarks []Bookmark `yaml:"Bookmarks"`
- Tracker string `yaml:"Tracker"`
+ Username string `yaml:"Username"`
+ IconID int `yaml:"IconID"`
+ Bookmarks []Bookmark `yaml:"Bookmarks"`
+ Tracker string `yaml:"Tracker"`
+ EnableBell bool `yaml:"EnableBell"`
}
func (cp *ClientPrefs) IconBytes() []byte {
@@ -466,6 +467,10 @@ func (c *Client) renderUserList() {
}
func handleClientChatMsg(c *Client, t *Transaction) (res []Transaction, err error) {
+ if c.pref.EnableBell {
+ fmt.Println("\a")
+ }
+
_, _ = fmt.Fprintf(c.UI.chatBox, "%s \n", t.GetField(fieldData).Data)
return res, err