Compare commits
1 Commits
decoupling
...
5480f1ae2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5480f1ae2e |
@@ -30,14 +30,17 @@ async def _try_publish(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Publish an AP activity if federation is available and user has a profile."""
|
"""Publish an AP activity if federation is available and user has a profile."""
|
||||||
if not services.has("federation"):
|
if not services.has("federation"):
|
||||||
|
log.debug("_try_publish: no federation service")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not user_id:
|
if not user_id:
|
||||||
|
log.debug("_try_publish: no user_id for %s#%s", source_type, source_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check user has an ActorProfile (chose a username)
|
# Check user has an ActorProfile (chose a username)
|
||||||
actor = await services.federation.get_actor_by_user_id(session, user_id)
|
actor = await services.federation.get_actor_by_user_id(session, user_id)
|
||||||
if not actor:
|
if not actor:
|
||||||
|
log.warning("_try_publish: no ActorProfile for user_id=%s", user_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Don't re-publish if we already have an activity for this source
|
# Don't re-publish if we already have an activity for this source
|
||||||
@@ -45,6 +48,7 @@ async def _try_publish(
|
|||||||
session, source_type, source_id,
|
session, source_type, source_id,
|
||||||
)
|
)
|
||||||
if existing and activity_type == "Create":
|
if existing and activity_type == "Create":
|
||||||
|
log.debug("_try_publish: already published %s#%s", source_type, source_id)
|
||||||
return # Already published
|
return # Already published
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user