userinfo: remove redundant custom is bot field

This commit is contained in:
Tulir Asokan
2026-03-28 22:44:24 +02:00
parent bb405b4773
commit a96bf7ed95
3 changed files with 2 additions and 4 deletions

View File

@@ -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,
}
}

View File

@@ -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"`

View File

@@ -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) {