Make backfilling code compatible with threads

This doesn't trigger thread backfill yet, but the backfill methods can
handle threads now.
This commit is contained in:
Tulir Asokan
2023-06-18 20:09:21 +03:00
parent 248664f8b0
commit 8ebad277f5
6 changed files with 84 additions and 35 deletions

View File

@@ -207,6 +207,7 @@ func (mp *MediaPatterns) Avatar(userID, avatarID, ext string) id.ContentURI {
type BackfillLimitPart struct {
DM int `yaml:"dm"`
Channel int `yaml:"channel"`
Thread int `yaml:"thread"`
}
func (bc *BridgeConfig) GetResendBridgeInfo() bool {

View File

@@ -79,8 +79,10 @@ func DoUpgrade(helper *up.Helper) {
helper.Copy(up.Bool, "bridge", "backfill", "enabled")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "initial", "dm")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "initial", "channel")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "initial", "thread")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "missed", "dm")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "missed", "channel")
helper.Copy(up.Int, "bridge", "backfill", "forward_limits", "missed", "thread")
helper.Copy(up.Int, "bridge", "backfill", "max_guild_members")
helper.Copy(up.Bool, "bridge", "encryption", "allow")
helper.Copy(up.Bool, "bridge", "encryption", "default")