forked from lug/matterbridge
		
	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
This commit is contained in:
		| @@ -122,6 +122,7 @@ func (b *Birc) handleNewConnection(client *girc.Client, event girc.Event) { | |||||||
| 	i := b.i | 	i := b.i | ||||||
| 	b.Nick = event.Params[0] | 	b.Nick = event.Params[0] | ||||||
|  |  | ||||||
|  | 	i.Handlers.ClearAll() | ||||||
| 	i.Handlers.AddBg("PRIVMSG", b.handlePrivMsg) | 	i.Handlers.AddBg("PRIVMSG", b.handlePrivMsg) | ||||||
| 	i.Handlers.AddBg("CTCP_ACTION", b.handlePrivMsg) | 	i.Handlers.AddBg("CTCP_ACTION", b.handlePrivMsg) | ||||||
| 	i.Handlers.Add(girc.RPL_TOPICWHOTIME, b.handleTopicWhoTime) | 	i.Handlers.Add(girc.RPL_TOPICWHOTIME, b.handleTopicWhoTime) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Bryan Davis
					Bryan Davis