kopia lustrzana https://github.com/snarfed/bridgy-fed
noop: expand a few log messages
rodzic
7e3613ab6c
commit
e66ca3fb7f
|
@ -194,7 +194,7 @@ class ActivityPub(User, Protocol):
|
|||
who we're delivering to and its id is populated into ``cc``.
|
||||
"""
|
||||
if to_cls.is_blocklisted(url):
|
||||
logger.info(f'Skipping sending to {url}')
|
||||
logger.info(f'Skipping sending to blocklisted {url}')
|
||||
return False
|
||||
|
||||
orig_as2 = orig_obj.as_as2() if orig_obj else None
|
||||
|
@ -202,6 +202,7 @@ class ActivityPub(User, Protocol):
|
|||
orig_obj=orig_as2)
|
||||
|
||||
if g.user:
|
||||
logger.debug(f'Overwriting actor with g.user {g.user.ap_actor()}')
|
||||
activity['actor'] = g.user.ap_actor()
|
||||
elif not activity.get('actor'):
|
||||
logger.warning('Outgoing AP activity has no actor!')
|
||||
|
|
|
@ -272,7 +272,7 @@ class ATProto(User, Protocol):
|
|||
|
||||
type = as1.object_type(obj.as1)
|
||||
if type in ('accept', 'undo'):
|
||||
logger.info(f'Skipping sending to {url}')
|
||||
logger.info(f'Skipping unsupported type {type}, not writing to repo')
|
||||
return False
|
||||
elif type == 'post':
|
||||
type = as1.object_type(as1.get_object(obj.as1))
|
||||
|
|
|
@ -706,6 +706,7 @@ class Protocol:
|
|||
if not to_id or not from_id:
|
||||
error(f'Follow activity requires object(s). Got: {obj.as1}')
|
||||
|
||||
logger.info(f'Follow {from_id} => {to_id}')
|
||||
to_cls = Protocol.for_id(to_id)
|
||||
if not to_cls:
|
||||
error(f"Couldn't determine protocol for {to_id}")
|
||||
|
|
13
web.py
13
web.py
|
@ -316,10 +316,15 @@ class Web(User, Protocol):
|
|||
# to followers, we just update our stored objects (elsewhere) and web
|
||||
# users consume them via feeds.
|
||||
verb = obj.as1.get('verb')
|
||||
if (verb in ('accept', 'undo')
|
||||
or url not in as1.targets(obj.as1)
|
||||
or to_cls.is_blocklisted(url)):
|
||||
logger.info(f'Skipping sending to {url}')
|
||||
|
||||
if verb in ('accept', 'undo'):
|
||||
logger.info(f'Skipping sending {verb} (not supported in webmention/mf2) to {url}')
|
||||
return False
|
||||
elif url not in as1.targets(obj.as1):
|
||||
logger.info(f'Skipping sending to {url} , not a target in the object')
|
||||
return False
|
||||
elif to_cls.is_blocklisted(url):
|
||||
logger.info(f'Skipping sending to blocklisted {url}')
|
||||
return False
|
||||
|
||||
source_url = obj.proxy_url()
|
||||
|
|
Ładowanie…
Reference in New Issue