kopia lustrzana https://github.com/snarfed/bridgy-fed
noop: dms: tweak logging
rodzic
e5dadb303f
commit
207ac48e80
|
@ -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
4
dms.py
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue