From aa6c5628e9b48303826ee0fa5fbb826e2c6cf54f Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 4 May 2020 18:36:55 +0200 Subject: Notify user of stuff going on in backends (not done for FB Messenger) --- connector/irc/irc.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'connector/irc') diff --git a/connector/irc/irc.go b/connector/irc/irc.go index cf93893..bee2bca 100644 --- a/connector/irc/irc.go +++ b/connector/irc/irc.go @@ -270,8 +270,7 @@ func (irc *IRC) connectLoop(c *girc.Client) { } if err := c.Connect(); err != nil { irc.connected = false - fmt.Printf("IRC failed to connect / disconnected: %s\n", err) - fmt.Printf("Retrying in %ds\n", irc.timeout) + irc.handler.SystemMessage(fmt.Sprintf("IRC failed to connect / disconnected (%s), reconnecting in %ds", err, irc.timeout)) time.Sleep(time.Duration(irc.timeout) * time.Second) irc.timeout *= 2 if irc.timeout > 600 { @@ -284,7 +283,7 @@ func (irc *IRC) connectLoop(c *girc.Client) { } func (irc *IRC) ircConnected(c *girc.Client, e girc.Event) { - fmt.Printf("ircConnected ^^^^\n") + irc.handler.SystemMessage("Connected to IRC.") irc.timeout = 10 irc.connected = true } -- cgit v1.2.3