connector: handle supergroup upgrades (#118)

Co-authored-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
Conan
2025-08-07 03:09:24 +08:00
committed by GitHub
parent 3462b75c76
commit 3ae88caa80
3 changed files with 69 additions and 1 deletions
+3
View File
@@ -82,6 +82,8 @@ type TelegramConfig struct {
AlwaysCustomEmojiReaction bool `yaml:"always_custom_emoji_reaction"`
SavedMessagesAvatar id.ContentURIString `yaml:"saved_message_avatar"`
AlwaysTombstoneOnSupergroupMigration bool `yaml:"always_tombstone_on_supergroup_migration"`
}
func (c TelegramConfig) ShouldBridge(participantCount int) bool {
@@ -120,6 +122,7 @@ func upgradeConfig(helper up.Helper) {
helper.Copy(up.Bool, "sync", "direct_chats")
helper.Copy(up.Bool, "always_custom_emoji_reaction")
helper.Copy(up.Str, "saved_message_avatar")
helper.Copy(up.Bool, "always_tombstone_on_supergroup_migration")
}
func (tg *TelegramConnector) GetConfig() (example string, data any, upgrader up.Upgrader) {