Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab user ID from account.xAccount, not from the users table #423

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions src/account_x/x_account_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2652,21 +2652,10 @@ export class XAccountController {
});
}

// Get the current user's user ID
let userRow: XUserRow;
try {
userRow = exec(this.db, `
SELECT *
FROM user
WHERE screenName = ?
`, [this.account.username], "get") as XUserRow;
} catch (e) {
return `Error selecting user: ${e}`;
}

// Handle replies
const userID = this.account.userID;
let reply = null;
if (tweet.isReply && tweet.replyUserID == userRow.userID) {
if (tweet.isReply && tweet.replyUserID == userID) {
// Find the parent tweet migration
let parentMigration: XTweetBlueskyMigrationRow;
try {
Expand All @@ -2693,7 +2682,7 @@ export class XAccountController {
} catch (e) {
return `Error selecting parent tweet: ${e}`;
}
if (parentTweet && parentTweet.isReply && parentTweet.replyUserID == userRow.userID) {
if (parentTweet && parentTweet.isReply && parentTweet.replyUserID == userID) {
rootTweetID = parentTweet.replyTweetID;
} else {
foundRoot = true;
Expand Down