From 89bbc565e6838c868fb365c75023856806eaa218 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:11:38 -0800 Subject: Add option to trigger terminal bell for chat messages --- hotline/client.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'hotline/client.go') 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 -- cgit