From a96bf7ed95a5ffa6b7dc3f964bc1424333a76572 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 28 Mar 2026 22:44:24 +0200 Subject: [PATCH] userinfo: remove redundant custom is bot field --- cmd/mautrix-telegram/legacyprovisioning.go | 2 +- pkg/connector/metadata.go | 1 - pkg/connector/userinfo.go | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/mautrix-telegram/legacyprovisioning.go b/cmd/mautrix-telegram/legacyprovisioning.go index 5715266f..6a35bf12 100644 --- a/cmd/mautrix-telegram/legacyprovisioning.go +++ b/cmd/mautrix-telegram/legacyprovisioning.go @@ -362,7 +362,7 @@ func legacyContactInfoFromGhost(ghost *bridgev2.Ghost) *legacyContactInfo { Name: ghost.Name, Username: username, Phone: phone, - IsBot: ghost.Metadata.(*connector.GhostMetadata).IsBot, + IsBot: ghost.IsBot, AvatarURL: ghost.AvatarMXC, } } diff --git a/pkg/connector/metadata.go b/pkg/connector/metadata.go index be27a5d0..c1755171 100644 --- a/pkg/connector/metadata.go +++ b/pkg/connector/metadata.go @@ -41,7 +41,6 @@ func (tg *TelegramConnector) GetDBMetaTypes() database.MetaTypes { type GhostMetadata struct { IsPremium bool `json:"is_premium,omitempty"` - IsBot bool `json:"is_bot,omitempty"` IsChannel bool `json:"is_channel,omitempty"` Deleted bool `json:"deleted,omitempty"` NotMin bool `json:"not_min,omitempty"` diff --git a/pkg/connector/userinfo.go b/pkg/connector/userinfo.go index 6f5f9b53..b98cbd13 100644 --- a/pkg/connector/userinfo.go +++ b/pkg/connector/userinfo.go @@ -281,9 +281,8 @@ func (t *TelegramClient) wrapUserInfo(ctx context.Context, u tg.UserClass, ghost ExtraUpdates: func(ctx context.Context, ghost *bridgev2.Ghost) (changed bool) { meta := ghost.Metadata.(*GhostMetadata) if !user.Min { - changed = changed || meta.IsPremium != user.Premium || meta.IsBot != user.Bot || meta.IsMin() + changed = changed || meta.IsPremium != user.Premium || meta.IsMin() meta.IsPremium = user.Premium - meta.IsBot = user.Bot meta.Deleted = user.Deleted meta.NotMin = true if meta.ContactSource == 0 || meta.ContactSource == t.telegramUserID || (!user.Contact && meta.SourceIsContact) {