From af231c4d3d27bcf34ab49c88d172ad6ebfaa7023 Mon Sep 17 00:00:00 2001
From: Tagadda <36127788+Tagadda@users.noreply.github.com>
Date: Sat, 9 Jun 2018 14:45:17 +0200
Subject: [PATCH] Don't follow locked accounts

---
 index.js | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js
index 9676fc1..2d40891 100644
--- a/index.js
+++ b/index.js
@@ -39,19 +39,24 @@ client.on('update', (msg) => {
         return;
     }
 
-    // This will be... not optimal I think.
-    if (following.has(acct)) {
-        console.log('ALREADY FOLLOWS: ' + acct);
+    // Don't follow locked accounts
+    if(msg.account.locked === true) {
+        console.log("LOCKED: " + acct);
         return;
     }
 
-
     // Respect #nobot
     if (striptags(msg.account.note).match(/#nobot/i)) {
         client.mute_user(id);
         console.log("MUTED #nobot: " + acct);
     }
 
+    // This will be... not optimal I think.
+    if (following.has(acct)) {
+        console.log('ALREADY FOLLOWS: ' + acct);
+        return;
+    }
+
     following.add(acct);
     client.follow(id);
     console.log("NOW FOLLOWS: " + acct);
-- 
GitLab