From d9b9b868c9d82a715da78e134cbfbe52c64f3a35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 11 Mar 2024 22:28:00 +0100 Subject: [PATCH] Continued: - added aliases for misskey, mastodon and pleroma (each one) - moved mastodon aliases to module ("private") variable, please don't access it outside the module! --- fba/helpers/software.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/fba/helpers/software.py b/fba/helpers/software.py index 7ce6fdb..43746d8 100644 --- a/fba/helpers/software.py +++ b/fba/helpers/software.py @@ -31,6 +31,16 @@ relays = [ "pub-relay" ] +# Aliases for mastodon +_mastodon_aliases = [ + "hometown", + "ecko", + "fedibird", + "glitchcafe", + "kmyblue", + "nagitodon" +] + # Aliases for misskey _misskey_aliases = [ "slipfox calckey", @@ -64,7 +74,8 @@ _misskey_aliases = [ "miraiskey", "lovers", "rosekey", - "hijikey" + "hijikey", + "shrimpkey" ] @lru_cache @@ -83,13 +94,13 @@ def alias(software: str) -> str: cleared = tidyup.domain(software) logger.debug("cleared='%s'- AFTER!", cleared) - if cleared in ["akkoma", "rebased", "akkounfucked", "ched", "incestoma", "revolver"]: + if cleared in ["akkoma", "rebased", "akkounfucked", "ched", "incestoma", "revolver"] or "pleroma" in cleared: logger.debug("Setting pleroma: cleared='%s'", cleared) cleared = "pleroma" elif "radiant" in cleared: logger.debug("Setting radiant: cleared='%s'", cleared) cleared = "radiant" - elif cleared in ["hometown", "ecko", "fedibird", "glitchcafe", "kmyblue"] or "되는 마스토돈" in cleared or "mastodon" in cleared: + elif cleared in _mastodon_aliases or "되는 마스토돈" in cleared or "mastodon" in cleared: logger.debug("Setting mastodon: cleared='%s'", cleared) cleared = "mastodon" elif cleared in _misskey_aliases or "shumihub" in cleared or "мисскей" in cleared or "milkey" in cleared or "misskey" in cleared: -- 2.39.5