From 97c944bb632fee44a56fe7864dca22c905845f4d Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 23 Dec 2017 00:11:30 +0100 Subject: Add RejoinDelay option. Delay to rejoin after channel kick (irc). Closes #322 --- bridge/config/config.go | 1 + bridge/irc/irc.go | 1 + 2 files changed, 2 insertions(+) (limited to 'bridge') diff --git a/bridge/config/config.go b/bridge/config/config.go index 69531440..13b7a8d0 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -81,6 +81,7 @@ type Protocol struct { Password string // IRC,mattermost,XMPP,matrix PrefixMessagesWithNick bool // mattemost, slack Protocol string // all protocols + RejoinDelay int // IRC ReplaceMessages [][]string // all protocols ReplaceNicks [][]string // all protocols RemoteNickFormat string // all protocols diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index c9c8cbb2..b7465977 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -267,6 +267,7 @@ func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) { channel := event.Params[0] if event.Command == "KICK" { flog.Infof("Got kicked from %s by %s", channel, event.Source.Name) + time.Sleep(time.Duration(b.Config.RejoinDelay) * time.Second) b.Remote <- config.Message{Username: "system", Text: "rejoin", Channel: channel, Account: b.Account, Event: config.EVENT_REJOIN_CHANNELS} return } -- cgit v1.2.3