Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrepol742 committed Apr 5, 2024
1 parent 015e7d8 commit 2254f1e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,19 +919,11 @@ function main(fca_state, login, cb) {
fs.writeFileSync(__dirname + "/data/cookies/" + login + ".bin", getAppState(redfox), "utf8");
utils.log("cookie_state " + login + " synchronized");
isAppState = false;
if (typeof cb === "function") {
cb(false);
}
if (typeof cb === "function") cb(false);
}

if (process.env.LOCK_THREAD_ID && event.threadID != process.env.LOCK_THREAD_ID) return;

// check if thread lock exists and is not equal to current bot id
// then return
if (settingsThread[event.threadID] && settingsThread[event.threadID].lock && settingsThread[event.threadID].lock != redfox.getCurrentUserID()) {
return;
}

// if the current bot id is not the root user
if (!isMyId(redfox.getCurrentUserID())) {
// if the settings thread is undefined
Expand All @@ -951,8 +943,10 @@ function main(fca_state, login, cb) {
utils.log("thread_lock " + event.threadID + " to " + redfox.getCurrentUserID());
}

// check if thread lock exists and is not equal to current bot id
// then return
const threadLock = settingsThread[event.threadID].lock;
if (threadLock != redfox.getCurrentUserID()) {
if (threadLock && threadLock != redfox.getCurrentUserID()) {
if (accounts.includes(threadLock)) return;
for (let threads in settingsThread) {
if (settingsThread[threads].lock && settingsThread[threads].lock == threadLock) {
Expand Down

0 comments on commit 2254f1e

Please sign in to comment.