mirror of
https://github.com/mautrix/telegram.git
synced 2026-05-16 23:15:45 +03:00
userinfo: remove redundant custom is bot field
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user