Fediverse: black

This commit is contained in:
Valentin Lorentz 2020-05-16 23:14:46 +02:00
parent b78973265b
commit 83c49ec43a
2 changed files with 38 additions and 36 deletions

View File

@ -216,20 +216,26 @@ class Fediverse(callbacks.PluginRegexp):
irc.network,
):
# show CW and content
res = [_("%s: \x02[CW %s]\x02 %s") % (
res = [
_("%s: \x02[CW %s]\x02 %s")
% (
author_fullname,
cw,
utils.web.htmlToText(status["content"]),
)]
)
]
else:
# show CW but not content
res = [_("%s: CW %s") % (author_fullname, cw)]
else:
# no CW, show content
res = [_("%s: %s") % (
res = [
_("%s: %s")
% (
author_fullname,
utils.web.htmlToText(status["content"]),
)]
)
]
for attachment in status.get("attachment", []):
res.append(utils.str.url(attachment.get("url")))

View File

@ -226,23 +226,19 @@ STATUS_WITH_PHOTO_VALUE = {
"mediaType": "image/jpeg",
"name": "IMG_foo.jpg",
"type": "Document",
"url": "https://example.org/foo.jpg"
"url": "https://example.org/foo.jpg",
}
],
"attributedTo": "https://example.org/users/someuser",
"cc": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": ["https://www.w3.org/ns/activitystreams#Public"],
"content": "Here is a picture",
"id": "https://example.org/users/someuser/statuses/123",
"published": "2020-05-08T01:23:45Z",
"sensitive": False,
"summary": "",
"tag": [],
"to": [
"https://example.org/users/someuser/followers"
],
"type": "Note"
"to": ["https://example.org/users/someuser/followers"],
"type": "Note",
}
STATUS_WITH_PHOTO_DATA = json.dumps(STATUS_WITH_PHOTO_VALUE).encode()