summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorBryan Davis <github@casadebender.com>2022-04-07 15:00:17 -0600
committerGitHub <noreply@github.com>2022-04-07 23:00:17 +0200
commitf044b948e257814e8e1f70d4b66821bfd9c2ff06 (patch)
treed8b3371fa43f8db5f0f209dee92c31ec34399b4a /bridge
parent32474a5f4d4ae74303c224090a5d0a076a1e3f39 (diff)
downloadmatterbridge-msglm-f044b948e257814e8e1f70d4b66821bfd9c2ff06.tar.gz
matterbridge-msglm-f044b948e257814e8e1f70d4b66821bfd9c2ff06.tar.bz2
matterbridge-msglm-f044b948e257814e8e1f70d4b66821bfd9c2ff06.zip
Clear existing IRC event handlers before connecting new ones (#1795)
Clear all existing IRC event handler registrations before registering new handlers in case we are connecting via a BNC and are seeing a reconnect. Fixes #1564
Diffstat (limited to 'bridge')
-rw-r--r--bridge/irc/handlers.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/bridge/irc/handlers.go b/bridge/irc/handlers.go
index 987df2c5..7a7b4b42 100644
--- a/bridge/irc/handlers.go
+++ b/bridge/irc/handlers.go
@@ -122,6 +122,7 @@ func (b *Birc) handleNewConnection(client *girc.Client, event girc.Event) {
i := b.i
b.Nick = event.Params[0]
+ i.Handlers.ClearAll()
i.Handlers.AddBg("PRIVMSG", b.handlePrivMsg)
i.Handlers.AddBg("CTCP_ACTION", b.handlePrivMsg)
i.Handlers.Add(girc.RPL_TOPICWHOTIME, b.handleTopicWhoTime)