Tweak the lookup and the OG metedata tasks

Now we don't fetch OG metadata for AP profile
This commit is contained in:
Thomas Sileo
2018-07-22 11:44:42 +02:00
parent a841efc9e8
commit a165e36303
4 changed files with 25 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ from little_boxes import strtobool
from little_boxes.activitypub import _to_list
from little_boxes.backend import Backend
from little_boxes.errors import ActivityGoneError
from little_boxes.errors import NotAnActivityError
from little_boxes.errors import Error
from config import BASE_URL
@@ -319,17 +320,16 @@ class MicroblogPubBackend(Backend):
@ensure_it_is_me
def inbox_announce(self, as_actor: ap.Person, announce: ap.Announce) -> None:
if isinstance(announce._data["object"], str) and not announce._data[
"object"
].startswith("http"):
# TODO(tsileo): actually drop it without storing it and better logging, also move the check somewhere else
# or remote it?
logger.warn(
# TODO(tsileo): actually drop it without storing it and better logging, also move the check somewhere else
# or remove it?
try:
obj = announce.get_object()
except NotAnActivityError:
logger.exception(
f'received an Annouce referencing an OStatus notice ({announce._data["object"]}), dropping the message'
)
return
obj = announce.get_object()
DB.activities.update_one(
{"remote_id": announce.id},
{