diff --git a/plugins/Fediverse/plugin.py b/plugins/Fediverse/plugin.py index 96d553095..ae3d3837f 100644 --- a/plugins/Fediverse/plugin.py +++ b/plugins/Fediverse/plugin.py @@ -216,20 +216,26 @@ class Fediverse(callbacks.PluginRegexp): irc.network, ): # show CW and content - res = [_("%s: \x02[CW %s]\x02 %s") % ( - author_fullname, - cw, - utils.web.htmlToText(status["content"]), - )] + 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") % ( - author_fullname, - utils.web.htmlToText(status["content"]), - )] + res = [ + _("%s: %s") + % ( + author_fullname, + utils.web.htmlToText(status["content"]), + ) + ] for attachment in status.get("attachment", []): res.append(utils.str.url(attachment.get("url"))) diff --git a/plugins/Fediverse/test_data.py b/plugins/Fediverse/test_data.py index bb79e0a69..b16b8dfab 100644 --- a/plugins/Fediverse/test_data.py +++ b/plugins/Fediverse/test_data.py @@ -216,33 +216,29 @@ STATUS_DATA = json.dumps(STATUS_VALUE).encode() STATUS_WITH_PHOTO_URL = "https://example.org/users/someuser/statuses/123" STATUS_WITH_PHOTO_VALUE = { - "@context": [ - "https://www.w3.org/ns/activitystreams", - "https://example.org/schemas/litepub-0.1.jsonld", - ], - "actor": "https://example.org/users/someuser", - "attachment": [ - { - "mediaType": "image/jpeg", - "name": "IMG_foo.jpg", - "type": "Document", - "url": "https://example.org/foo.jpg" - } - ], - "attributedTo": "https://example.org/users/someuser", - "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" + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://example.org/schemas/litepub-0.1.jsonld", + ], + "actor": "https://example.org/users/someuser", + "attachment": [ + { + "mediaType": "image/jpeg", + "name": "IMG_foo.jpg", + "type": "Document", + "url": "https://example.org/foo.jpg", + } + ], + "attributedTo": "https://example.org/users/someuser", + "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", } STATUS_WITH_PHOTO_DATA = json.dumps(STATUS_WITH_PHOTO_VALUE).encode()