noop: dms: tweak logging

pull/1683/head
Ryan Barrett 2025-01-11 15:22:10 -08:00
rodzic e5dadb303f
commit 207ac48e80
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -72,9 +72,9 @@ def web_opt_out_domains():
_WEB_OPT_OUT_DOMAINS = {
key.id() for key in Query(
'MagicKey',
# don't add status to this! we use status=blocked for Web users
# that are fediverse servers - see Web.status - but we don't
# want that to extend to ActivityPub users on those domains
# don't add status to this! we use status=owns-webfinger for Web
# users that are fediverse servers - see Web.status - but we
# don't want that to extend to ActivityPub users on those domains
filters=FilterNode('manual_opt_out', '=', True)
).fetch(keys_only=True)
}

4
dms.py
Wyświetl plik

@ -109,7 +109,7 @@ def receive(*, from_user, obj):
else obj.as1)
logger.info(f'got DM from {from_user.key.id()} to {to_proto.LABEL}: {inner_obj.get("content")}')
# parse and handle message
# parse message
soup = util.parse_html(inner_obj.get('content', ''))
content = soup.get_text().strip().lower()
tokens = content.split()
@ -119,7 +119,7 @@ def receive(*, from_user, obj):
bot_handles = (DOMAINS + ids.BOT_ACTOR_AP_IDS
+ tuple(h.lstrip('@') for h in ids.BOT_ACTOR_AP_HANDLES))
if tokens and tokens[0].lstrip('@') in bot_handles:
logger.info(f' first token is bot mention, removing')
logger.debug(f' first token is bot mention, removing')
tokens = tokens[1:]
if not tokens: