print(f"INFO: Checking {len(peerlist)} instances from {domain} ...")
for instance in peerlist:
instance = instance.lower()
+
if instance.find("@") > 0:
print("WARNING: Bad instance name,domain:", instance, domain)
continue
- blacklisted = False
- for peer in fba.blacklist:
- if peer in instance:
- blacklisted = True
-
- if blacklisted:
- # NOISY-DEBUG: print("DEBUG: domain is blacklisted:", domain)
+ if fba.is_blacklisted(instance):
+ # NOISY-DEBUG: print("DEBUG: instance is blacklisted:", instance)
continue
# NOISY-DEBUG: print("DEBUG: Handling instance:", instance)
# Loop through some instances
fba.c.execute(
- "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
+ "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (software IS NULL OR last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
)
for instance in fba.c.fetchall():
- blacklisted = False
- for domain in fba.blacklist:
- if domain in instance[0]:
- blacklisted = True
-
- if blacklisted:
+ if fba.is_blacklisted(instance[0]):
# NOISY-DEBUG: print("DEBUG: domain is blacklisted:", instance)
continue