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,
|
Name: ghost.Name,
|
||||||
Username: username,
|
Username: username,
|
||||||
Phone: phone,
|
Phone: phone,
|
||||||
IsBot: ghost.Metadata.(*connector.GhostMetadata).IsBot,
|
IsBot: ghost.IsBot,
|
||||||
AvatarURL: ghost.AvatarMXC,
|
AvatarURL: ghost.AvatarMXC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ func (tg *TelegramConnector) GetDBMetaTypes() database.MetaTypes {
|
|||||||
|
|
||||||
type GhostMetadata struct {
|
type GhostMetadata struct {
|
||||||
IsPremium bool `json:"is_premium,omitempty"`
|
IsPremium bool `json:"is_premium,omitempty"`
|
||||||
IsBot bool `json:"is_bot,omitempty"`
|
|
||||||
IsChannel bool `json:"is_channel,omitempty"`
|
IsChannel bool `json:"is_channel,omitempty"`
|
||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
NotMin bool `json:"not_min,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) {
|
ExtraUpdates: func(ctx context.Context, ghost *bridgev2.Ghost) (changed bool) {
|
||||||
meta := ghost.Metadata.(*GhostMetadata)
|
meta := ghost.Metadata.(*GhostMetadata)
|
||||||
if !user.Min {
|
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.IsPremium = user.Premium
|
||||||
meta.IsBot = user.Bot
|
|
||||||
meta.Deleted = user.Deleted
|
meta.Deleted = user.Deleted
|
||||||
meta.NotMin = true
|
meta.NotMin = true
|
||||||
if meta.ContactSource == 0 || meta.ContactSource == t.telegramUserID || (!user.Contact && meta.SourceIsContact) {
|
if meta.ContactSource == 0 || meta.ContactSource == t.telegramUserID || (!user.Contact && meta.SourceIsContact) {
|
||||||
|
|||||||
Reference in New Issue
Block a user