From 9d77bebe3ebb33cabb17391f6990de263aa1b658 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 17 Jul 2024 12:34:28 -0600 Subject: [PATCH] config: remove set_private_chat_portal_meta option It's handled by bridgev2 Signed-off-by: Sumner Evans --- pkg/connector/client.go | 11 +---------- pkg/connector/config.go | 3 --- pkg/connector/example-config.yaml | 4 ---- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/pkg/connector/client.go b/pkg/connector/client.go index 294f8582..30f97c5d 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -231,14 +231,6 @@ func (t *TelegramClient) GetChatInfo(ctx context.Context, portal *bridgev2.Porta return nil, err } - if t.main.Config.SetPrivateChatPortalMeta { - chatInfo.Name = userInfo.Name - chatInfo.Avatar = userInfo.Avatar - } else { - chatInfo.Name = ptr.Ptr("") - chatInfo.Avatar = &bridgev2.Avatar{Remove: true} - } - chatInfo.Members.Members = []bridgev2.ChatMember{ { EventSender: bridgev2.EventSender{ @@ -411,8 +403,7 @@ func (t *TelegramClient) GetChatInfo(ctx context.Context, portal *bridgev2.Porta } } default: - // fmt.Printf("%s %d\n", peerType, id) - panic("unimplemented getchatinfo") + panic(fmt.Sprintf("unsupported peer type %s", peerType)) } return &chatInfo, nil diff --git a/pkg/connector/config.go b/pkg/connector/config.go index 0d5592bb..52f0dad0 100644 --- a/pkg/connector/config.go +++ b/pkg/connector/config.go @@ -18,8 +18,6 @@ type TelegramConfig struct { AppID int `yaml:"app_id"` AppHash string `yaml:"app_hash"` - SetPrivateChatPortalMeta bool `yaml:"set_private_chat_portal_meta"` - AnimatedSticker media.AnimatedStickerConfig `yaml:"animated_sticker"` MemberList struct { @@ -37,7 +35,6 @@ var ExampleConfig string func upgradeConfig(helper up.Helper) { helper.Copy(up.Int, "app_id") helper.Copy(up.Str, "app_hash") - helper.Copy(up.Bool, "set_private_chat_portal_meta") helper.Copy(up.Str, "animated_sticker", "target") helper.Copy(up.Bool, "animated_sticker", "convert_from_webm") helper.Copy(up.Int, "animated_sticker", "args", "width") diff --git a/pkg/connector/example-config.yaml b/pkg/connector/example-config.yaml index e2927466..ccb48f57 100644 --- a/pkg/connector/example-config.yaml +++ b/pkg/connector/example-config.yaml @@ -2,10 +2,6 @@ app_id: 12345 app_hash: tjyd5yge35lbodk1xwzw2jstp90k55qz -# Whether to explicitly set the avatar and room name for private chat portal -# rooms. -set_private_chat_portal_meta: true - # Settings for converting animated stickers. animated_sticker: # Format to which animated stickers should be converted.