scoped store: implement new AccessHasher interface

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-10-10 14:45:39 -06:00
parent 48059a3a51
commit 73d0b189bb
5 changed files with 43 additions and 15 deletions
+4 -2
View File
@@ -441,8 +441,10 @@ 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 err := t.ScopedStore.SetAccessHash(ctx, ids.PeerTypeChannel, channel.ID, channel.AccessHash); err != nil {
return nil, err
if accessHash, ok := channel.GetAccessHash(); ok {
if err := t.ScopedStore.SetAccessHash(ctx, ids.PeerTypeChannel, channel.ID, accessHash); err != nil {
return nil, err
}
}
if !channel.Broadcast {