Skip to content

Commit 0fba7e0

Browse files
authored
Merge pull request #555 from lockdown-systems/fix-bluesky
fix: allow migration of deleted tweets
2 parents 818fa06 + 07fe32b commit 0fba7e0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/account_x/x_account_controller.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,10 +2539,9 @@ export class XAccountController {
25392539
AND tweet.deletedTweetAt IS NULL
25402540
`, ["RT @%", 0, username], "get") as Sqlite3Count;
25412541

2542-
// Tweets to migrate
2542+
// Tweets to migrate (including deleted tweets)
25432543
const toMigrateTweets = this.fetchTweetsWithMediaAndURLs(`
2544-
t.deletedTweetAt IS NULL
2545-
AND t.text NOT LIKE ?
2544+
t.text NOT LIKE ?
25462545
AND t.isLiked = ?
25472546
AND t.username = ?
25482547
AND t.tweetID NOT IN (SELECT tweetID FROM tweet_bsky_migration)
@@ -2558,11 +2557,10 @@ export class XAccountController {
25582557
AND tweet.text NOT LIKE ?
25592558
AND tweet.isLiked = ?
25602559
AND tweet.username = ?
2561-
AND tweet.deletedTweetAt IS NULL
25622560
AND (tweet.isReply = ? AND tweet.replyUserID != ?)
25632561
`, ["RT @%", 0, username, 1, userID], "get") as Sqlite3Count;
25642562

2565-
// Already migrated tweets
2563+
// Already migrated tweets (including deleted ones)
25662564
const alreadyMigratedTweets = this.fetchTweetsWithMediaAndURLs(`
25672565
t.text NOT LIKE ?
25682566
AND t.isLiked = ?
@@ -3189,7 +3187,7 @@ export class XAccountController {
31893187
throw new Error("Account not found");
31903188
}
31913189

3192-
if(!this.account.username) {
3190+
if (!this.account.username) {
31933191
const uuid = crypto.randomUUID();
31943192
const tempUsername = `deleted_account_${uuid.slice(0, 8)}`;
31953193
this.account.username = tempUsername;

0 commit comments

Comments
 (0)