diff --git a/pkg/connector/client.go b/pkg/connector/client.go index a6744698..a97c38b2 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -524,12 +524,13 @@ func (t *TelegramClient) getUserInfoFromTelegramUser(ctx context.Context, u tg.U return nil, fmt.Errorf("user is %T not *tg.User", user) } var identifiers []string - if accessHash, ok := user.GetAccessHash(); ok { - if err := t.ScopedStore.SetAccessHash(ctx, ids.PeerTypeUser, user.ID, accessHash); err != nil { - return nil, err - } - } if !user.Min { + if accessHash, ok := user.GetAccessHash(); ok { + if err := t.ScopedStore.SetAccessHash(ctx, ids.PeerTypeUser, user.ID, accessHash); err != nil { + return nil, err + } + } + if err := t.ScopedStore.SetUsername(ctx, ids.PeerTypeUser, user.ID, user.Username); err != nil { return nil, err } diff --git a/pkg/connector/telegram.go b/pkg/connector/telegram.go index f570cd37..86927c66 100644 --- a/pkg/connector/telegram.go +++ b/pkg/connector/telegram.go @@ -474,7 +474,8 @@ func (t *TelegramClient) updateGhost(ctx context.Context, userID int64, user *tg } func (t *TelegramClient) updateChannel(ctx context.Context, channel *tg.Channel) (*bridgev2.UserInfo, error) { - if accessHash, ok := channel.GetAccessHash(); ok { + if accessHash, ok := channel.GetAccessHash(); ok && !channel.Min { + fmt.Printf("UPDATE CHANNEL HAS ACCESS HASH %d %d\n", channel.ID, accessHash) if err := t.ScopedStore.SetAccessHash(ctx, ids.PeerTypeChannel, channel.ID, accessHash); err != nil { return nil, err }