diff --git a/plugins/Fediverse/plugin.py b/plugins/Fediverse/plugin.py index a82cfb15e..13d30d14b 100644 --- a/plugins/Fediverse/plugin.py +++ b/plugins/Fediverse/plugin.py @@ -237,11 +237,15 @@ class Fediverse(callbacks.PluginRegexp): else: return self._format_actor_fullname(author) elif isinstance(author, dict): + if author.get("type") == "Group": + # Typically, there is an actor named "Default channel" + # on PeerTube, which we do not want to show. + return None if author.get("id"): return self._format_author(irc, author["id"]) elif isinstance(author, list): return format( - "%L", [self._format_author(irc, item) for item in author] + "%L", filter(bool, [self._format_author(irc, item) for item in author]) ) else: return "" diff --git a/plugins/Fediverse/test.py b/plugins/Fediverse/test.py index 5c0b2f88b..d06c0ead7 100644 --- a/plugins/Fediverse/test.py +++ b/plugins/Fediverse/test.py @@ -438,15 +438,13 @@ class NetworklessFediverseTestCase(BaseFediverseTestCase): expected_requests = [ (PEERTUBE_VIDEO_URL, PEERTUBE_VIDEO_DATA), (PEERTUBE_ACTOR_URL, PEERTUBE_ACTOR_DATA), - (ACTOR_URL, ACTOR_DATA), ] with self.mockRequests(expected_requests): self.assertResponse( "status https://example.org/w/gABde9e210FGHre", "\x02name of video\x02 (1 hour, 26 minutes, and 0 seconds) " - "by \x02chocobozzz\x02 (@chocobozzz@peertube.cpy.re) " - "and \x02someuser\x02 (@someuser@example.org): " + "by \x02chocobozzz\x02 (@chocobozzz@peertube.cpy.re): " "description of the video with a second line", )