From: Roland Häder Date: Mon, 11 Mar 2024 21:28:00 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d9b9b868c9d82a715da78e134cbfbe52c64f3a35;p=fba.git 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! --- 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: