metadata: add pagination config for members initial sync

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-07-17 16:44:53 -06:00
parent ec56fb6b28
commit a0d88da480
3 changed files with 300 additions and 202 deletions
+14 -5
View File
@@ -14,17 +14,26 @@ import (
var _ bridgev2.ConfigValidatingNetwork = (*TelegramConnector)(nil)
type MemberListConfig struct {
MaxInitialSync int `yaml:"max_initial_sync"`
SyncChannels bool `yaml:"sync_channels"`
SkipDeleted bool `yaml:"skip_deleted"`
}
func (c MemberListConfig) NormalizedMaxInitialSync() int {
if c.MaxInitialSync < 0 {
return 10000
}
return c.MaxInitialSync
}
type TelegramConfig struct {
AppID int `yaml:"app_id"`
AppHash string `yaml:"app_hash"`
AnimatedSticker media.AnimatedStickerConfig `yaml:"animated_sticker"`
MemberList struct {
MaxInitialSync int `yaml:"max_initial_sync"`
SyncChannels bool `yaml:"sync_channels"`
SkipDeleted bool `yaml:"skip_deleted"`
} `yaml:"member_list"`
MemberList MemberListConfig `yaml:"member_list"`
MaxMemberCount int `yaml:"max_member_count"`
}