all: add support for topics and refactor other things

This commit is contained in:
Tulir Asokan
2025-12-06 14:52:39 +02:00
parent 14b3b1fed7
commit d5f87d2ec1
26 changed files with 797 additions and 390 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ func (t *TelegramClient) wrapChannelGhostInfo(ctx context.Context, channel *tg.C
var identifiers []string
if username, set := channel.GetUsername(); set {
err = t.ScopedStore.SetUsername(ctx, ids.PeerTypeChannel, channel.ID, username)
err = t.main.Store.Username.Set(ctx, ids.PeerTypeChannel, channel.ID, username)
if err != nil {
return nil, err
}
@@ -88,7 +88,7 @@ func (t *TelegramClient) wrapUserInfo(ctx context.Context, u tg.UserClass) (*bri
}
}
if err := t.ScopedStore.SetUsername(ctx, ids.PeerTypeUser, user.ID, user.Username); err != nil {
if err := t.main.Store.Username.Set(ctx, ids.PeerTypeUser, user.ID, user.Username); err != nil {
return nil, err
}
@@ -101,7 +101,7 @@ func (t *TelegramClient) wrapUserInfo(ctx context.Context, u tg.UserClass) (*bri
if phone, ok := user.GetPhone(); ok {
normalized := strings.TrimPrefix(phone, "+")
identifiers = append(identifiers, fmt.Sprintf("tel:+%s", normalized))
if err := t.ScopedStore.SetPhoneNumber(ctx, user.ID, normalized); err != nil {
if err := t.main.Store.PhoneNumber.Set(ctx, user.ID, normalized); err != nil {
return nil, err
}
}