commit ef67f219bcd14b248d8dc6eef24a57590ea3c9cc
Author: Wim <wim@42.be>
Date: Sun Apr 19 00:46:35 2020 +0000
diff --git a/bridge/bridge.go b/bridge/bridge.go
index 5612e35..eec2bfa 100644
--- a/bridge/bridge.go
+++ b/bridge/bridge.go
@@ -46 +47 @@ import (
"log"
"strings"
"sync"
+ "time"
"github.com/42wim/matterbridge/bridge/config"
"github.com/sirupsen/logrus"
@@ -746 +757 @@ func (b *Bridge) joinChannels(channels map[string]config.ChannelInfo, exists map
for ID, channel := range channels {
if !exists[ID] {
b.Log.Infof("%s: joining %s (ID: %s)", b.Account, channel.Name, ID)
+ time.Sleep(time.Duration(b.GetInt("JoinDelay")) * time.Millisecond)
err := b.JoinChannel(channel)
if err != nil {
return err
diff --git a/bridge/config/config.go b/bridge/config/config.go
index ea62d7c..dfb71ee 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -896 +897 @@ type Protocol struct {
IgnoreNicks string // all protocols
IgnoreMessages string // all protocols
Jid string // xmpp
+ JoinDelay string // all protocols
Label string // all protocols
Login string // mattermost, matrix
MediaDownloadBlackList []string
diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample
index 0aca45f..4082b6d 100644
--- a/matterbridge.toml.sample
+++ b/matterbridge.toml.sample
@@ -1776 +17712 @@ StripNick=false
#OPTIONAL (default false)
ShowTopicChange=false
+#Delay in milliseconds between channel joins
+#Only useful when you have a LOT of channels to join
+#See https://github.com/42wim/matterbridge/issues/1084
+#OPTIONAL (default 0)
+JoinDelay=0
+
###################################################################
#XMPP section
###################################################################