forked from forks/microblog.pub
Add tweak for forwarded activities from Hubzilla
This commit is contained in:
parent
4f0812988b
commit
e31ae7997d
1 changed files with 8 additions and 0 deletions
|
@ -40,6 +40,7 @@ from core.meta import by_type
|
||||||
from core.meta import flag
|
from core.meta import flag
|
||||||
from core.meta import inc
|
from core.meta import inc
|
||||||
from core.meta import upsert
|
from core.meta import upsert
|
||||||
|
from core.remote import server
|
||||||
from core.tasks import Tasks
|
from core.tasks import Tasks
|
||||||
from utils import now
|
from utils import now
|
||||||
|
|
||||||
|
@ -178,6 +179,13 @@ def post_to_inbox(activity: ap.BaseActivity) -> None:
|
||||||
Tasks.process_reply(activity.get_object_id())
|
Tasks.process_reply(activity.get_object_id())
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Hubzilla forward activities in a Create, process them as possible replies
|
||||||
|
if activity.has_type(ap.ActivityType.CREATE) and server(activity.id) != server(
|
||||||
|
activity.get_object_id()
|
||||||
|
):
|
||||||
|
Tasks.process_reply(activity.get_object_id())
|
||||||
|
return
|
||||||
|
|
||||||
if DB.activities.find_one({"box": Box.INBOX.value, "remote_id": activity.id}):
|
if DB.activities.find_one({"box": Box.INBOX.value, "remote_id": activity.id}):
|
||||||
# The activity is already in the inbox
|
# The activity is already in the inbox
|
||||||
logger.info(f"received duplicate activity {activity!r}, dropping it")
|
logger.info(f"received duplicate activity {activity!r}, dropping it")
|
||||||
|
|
Loading…
Reference in a new issue