From db0110393f70987c9b87643594d18df935ef91d5 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Mon, 4 Nov 2024 13:43:06 -0500 Subject: added the ability to use channels with password, fixes 35 --- rss.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'rss.go') diff --git a/rss.go b/rss.go index 60a8066..2c34459 100644 --- a/rss.go +++ b/rss.go @@ -21,7 +21,8 @@ import ( func GetFeed(feed FeedConfig, client *girc.Client, pool *pgxpool.Pool, - channel, groupName string, + channel []string, + groupName string, ) { rowName := groupName + "__" + feed.Name + "__" @@ -55,7 +56,7 @@ func GetFeed(feed FeedConfig, for _, item := range parsedFeed.Items { if item.PublishedParsed.Unix() > newestFromDB { - client.Cmd.Message(channel, parsedFeed.Title+": "+item.Title+">>>"+item.Link) + client.Cmd.Message(channel[0], parsedFeed.Title+": "+item.Title+">>>"+item.Link) } } @@ -77,7 +78,8 @@ func feedDispatcher( config RSSConfig, client *girc.Client, pool *pgxpool.Pool, - channel, groupName string, + channel []string, + groupName string, period int, ) { for { @@ -164,7 +166,7 @@ func runRSS(appConfig *TomlConfig, client *girc.Client) { for groupName, rss := range appConfig.Rss { log.Print("RSS: joining ", rss.Channel) - client.Cmd.Join(rss.Channel) + IrcJoin(client, rss.Channel) rssConfig := ParseRSSConfig(rss.RssFile) if rssConfig == nil { log.Print("Could not parse RSS config file " + rss.RssFile + ". Exiting.") -- cgit v1.2.3