diff --git a/user.go b/user.go index 956a620..e2ff4fb 100644 --- a/user.go +++ b/user.go @@ -406,15 +406,17 @@ func (user *User) slackMessageHandler(userTeam *database.UserTeam) { userTeam.Upsert() user.tryAutomaticDoublePuppeting(userTeam) - user.BridgeStates[userTeam.Key.TeamID].Send(status.BridgeState{StateEvent: status.StateBackfilling}) - user.log.Infofln("connected to team %s as %s", userTeam.TeamName, userTeam.SlackEmail) - portals := user.bridge.dbPortalsToPortals(user.bridge.DB.Portal.GetAllForUserTeam(userTeam.Key)) - for _, portal := range portals { - err := portal.ForwardBackfill() - if err != nil { - user.log.Warnfln("Forward backfill for portal %s failed: %v", portal.Key, err) + if (user.bridge.Config.Bridge.Backfill.Enable) { + user.BridgeStates[userTeam.Key.TeamID].Send(status.BridgeState{StateEvent: status.StateBackfilling}) + + portals := user.bridge.dbPortalsToPortals(user.bridge.DB.Portal.GetAllForUserTeam(userTeam.Key)) + for _, portal := range portals { + err := portal.ForwardBackfill() + if err != nil { + user.log.Warnfln("Forward backfill for portal %s failed: %v", portal.Key, err) + } } } user.BridgeStates[userTeam.Key.TeamID].Send(status.BridgeState{StateEvent: status.StateConnected})