diff options
| author | 2020-01-18 14:02:29 +0000 | |
|---|---|---|
| committer | 2020-01-18 14:02:47 +0000 | |
| commit | a9741344720d43aab8860c3cdbd16521452400ca (patch) | |
| tree | e44c9a60f921623eff9d1b41ee517669b5a3ee1b /modules | |
| parent | tolerate fediverse Notes without "cc"s (diff) | |
| signature | ||
tolerate fedi servers that present Notes as application/ld+json
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/fediverse/__init__.py | 2 | ||||
| -rw-r--r-- | modules/fediverse/ap_utils.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py index 0b8cc342..02c26d7d 100644 --- a/modules/fediverse/__init__.py +++ b/modules/fediverse/__init__.py @@ -79,7 +79,7 @@ class Module(ModuleManager.BaseModule): type = "Create" if not url == None: note_page = ap_utils.activity_request(url) - if not note_page.content_type == ap_utils.ACTIVITY_TYPE: + if not note_page.content_type in ap_utils.AP_TYPES: raise utils.EventError("That's not a fediverse URL") note = note_page.json() diff --git a/modules/fediverse/ap_utils.py b/modules/fediverse/ap_utils.py index 016f2ec3..0d44d523 100644 --- a/modules/fediverse/ap_utils.py +++ b/modules/fediverse/ap_utils.py @@ -8,6 +8,8 @@ LD_TYPE = ("application/ld+json; " JRD_TYPE = "application/jrd+json" ACTIVITY_TYPE = "application/activity+json" +AP_TYPES = [ACTIVITY_TYPE, "application/ld+json"] + def split_username(s): if s[0] == "@": s = s[1:] |
