takeout: use takeout for backwards backfill

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-09-04 15:18:25 -06:00
parent 4d4060f37b
commit 89b1caadbf
5 changed files with 104 additions and 11 deletions
+8
View File
@@ -8,12 +8,14 @@ import (
"slices"
"strconv"
"strings"
"sync"
"time"
"github.com/gotd/td/telegram"
"github.com/gotd/td/telegram/updates"
"github.com/gotd/td/tg"
"github.com/rs/zerolog"
"go.mau.fi/util/exsync"
"go.mau.fi/zerozap"
"go.uber.org/zap"
"maunium.net/go/mautrix/bridge/status"
@@ -50,6 +52,10 @@ type TelegramClient struct {
cachedContacts *tg.ContactsContacts
cachedContactsHash int64
takeoutLock sync.Mutex
takeoutAccepted *exsync.Event
stopTakeoutTimer *time.Timer
}
var (
@@ -114,6 +120,8 @@ func NewTelegramClient(ctx context.Context, tc *TelegramConnector, login *bridge
loginID: login.ID,
userID: networkid.UserID(login.ID),
userLogin: login,
takeoutAccepted: exsync.NewEvent(),
}
dispatcher := UpdateDispatcher{
UpdateDispatcher: tg.NewUpdateDispatcher(),