diff --git a/pkg/connector/metadata.go b/pkg/connector/metadata.go index 8ebecdba..33799180 100644 --- a/pkg/connector/metadata.go +++ b/pkg/connector/metadata.go @@ -46,7 +46,8 @@ type GhostMetadata struct { Deleted bool `json:"deleted,omitempty"` NotMin bool `json:"not_min,omitempty"` - ContactSource int64 `json:"contact_source,omitempty"` + ContactSource int64 `json:"contact_source,omitempty"` + SourceIsContact bool `json:"source_is_contact,omitempty"` } func (gm *GhostMetadata) IsMin() bool { diff --git a/pkg/connector/userinfo.go b/pkg/connector/userinfo.go index 3b06c85b..63f30977 100644 --- a/pkg/connector/userinfo.go +++ b/pkg/connector/userinfo.go @@ -216,8 +216,9 @@ func (t *TelegramClient) wrapUserInfo(ctx context.Context, u tg.UserClass, ghost meta.IsBot = user.Bot meta.Deleted = user.Deleted meta.NotMin = true - if meta.ContactSource == 0 { + if meta.ContactSource == 0 || (!user.Contact && meta.SourceIsContact) { meta.ContactSource = t.telegramUserID + meta.SourceIsContact = user.Contact } } return changed