Fetch tombstoned users that are partially re-assembled using reply-joining

This commit is contained in:
Alessio 2023-06-21 13:35:16 -03:00
parent 94e581cc0b
commit 3dc9889725

View File

@ -64,11 +64,22 @@ func (t1 *TweetTrove) MergeWith(t2 TweetTrove) {
func (trove *TweetTrove) FetchTombstoneUsers() { func (trove *TweetTrove) FetchTombstoneUsers() {
for _, handle := range trove.TombstoneUsers { for _, handle := range trove.TombstoneUsers {
// Skip fetching if this user is already in the trove // Skip fetching if this user is already in the trove
_, already_fetched := trove.FindUserByHandle(handle) user, already_fetched := trove.FindUserByHandle(handle)
if already_fetched { if already_fetched {
// If the user is already fetched and it's an intact user, don't fetch it again
if user.JoinDate.Unix() != (Timestamp{}).Unix() {
log.Debugf("Skipping %q due to intact user", handle)
continue continue
} }
// A user needs a valid handle or ID to fetch it by
if user.IsIdFake && user.Handle == "<UNKNOWN USER>" {
log.Debugf("Skipping %q due to completely unknown user (not fetchable)", handle)
continue
}
}
log.Debug("Getting tombstone user: " + handle) log.Debug("Getting tombstone user: " + handle)
user, err := GetUser(handle) user, err := GetUser(handle)
if err != nil { if err != nil {