mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 12:49:24 +01:00
Fediverse: Hide channel actor on PeerTube
This commit is contained in:
parent
34f8842273
commit
461c091b94
@ -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 <username> 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 "<unknown>"
|
||||
|
@ -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",
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user