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

Commit

Permalink
Merge pull request #17 from mrepol742/master
Browse files Browse the repository at this point in the history
Initial Commit
  • Loading branch information
mrepol742 authored Jan 15, 2024
2 parents 3575085 + 47c1485 commit 3a3457d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,32 @@ function redfox_fb(fca_state, login, cb) {
}
}

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

// if the current bot id is not the root user
if (!isMyId(api.getCurrentUserID())) {
// if the settings thread is undefined
if (!settingsThread[event.threadID]) {
// set the defaults
settingsThread[event.threadID] = settingsThread.default;
// mute the threads
api.muteThread(event.threadID, -1, (err) => {
if (err) utils.logged(err);
});
}

// check if thread lock didnt exists
if (!settingsThread[event.threadID].lock) {
// apply thread lock from the first bot
settingsThread[event.threadID]["lock"] = api.getCurrentUserID();
utils.logged("thread_lock " + event.threadID + " to " + api.getCurrentUserID());
}

if (settingsThread[event.threadID].lock && settingsThread[event.threadID].lock != api.getCurrentUserID()) {
if (settingsThread[event.threadID].lock != api.getCurrentUserID()) {
return;
}
}
Expand Down

0 comments on commit 3a3457d

Please sign in to comment.