From 72d0c8d9bce125be1b851b142b0f41242d496f6f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 6 Apr 2025 01:24:58 +0800 Subject: irc: Factor the IRC stuff into its own package --- server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server.go') diff --git a/server.go b/server.go index 3e02586..8c14e3e 100644 --- a/server.go +++ b/server.go @@ -18,6 +18,7 @@ import ( "time" "go.lindenii.runxiyu.org/forge/internal/database" + "go.lindenii.runxiyu.org/forge/internal/irc" "go.lindenii.runxiyu.org/forge/internal/misc" "go.lindenii.runxiyu.org/lindenii-common/cmap" goSSH "golang.org/x/crypto/ssh" @@ -31,9 +32,6 @@ type Server struct { sourceHandler http.Handler staticHandler http.Handler - ircSendBuffered chan string - ircSendDirectChan chan errorBack[string] - // globalData is passed as "global" when rendering HTML templates. globalData map[string]any @@ -45,6 +43,8 @@ type Server struct { packPasses cmap.Map[string, packPass] templates *template.Template + + ircBot *irc.Bot } func (s *Server) Setup() { @@ -192,7 +192,7 @@ func (s *Server) Run() { } // IRC bot - go s.ircBotLoop() + go s.ircBot.ConnectLoop() select {} } -- cgit v1.2.3