Additional group user path

main
Bob Mottram 2023-06-17 10:28:16 +01:00
parent c71c1b62be
commit 1037d31e4f
3 changed files with 9 additions and 5 deletions

View File

@ -2674,7 +2674,10 @@ def _command_options() -> None:
elif '/c/' in argb.followers:
nickname = argb.followers.split('/c/')[1]
nickname = remove_eol(nickname)
domain = argb.followers.split('/c/')[0]
elif '/m/' in argb.followers:
nickname = argb.followers.split('/m/')[1]
nickname = remove_eol(nickname)
domain = argb.followers.split('/m/')[0]
else:
# format: @nick@domain
if '@' not in argb.followers:
@ -2759,6 +2762,7 @@ def _command_options() -> None:
person_url = person_url.replace('/author/', '/actor/')
person_url = person_url.replace('/u/', '/actor/')
person_url = person_url.replace('/c/', '/actor/')
person_url = person_url.replace('/m/', '/actor/')
if not person_url:
# try single user instance
person_url = http_prefix + '://' + domain

View File

@ -1443,15 +1443,15 @@ def get_user_paths() -> []:
e.g. /users/nickname, /channel/nickname
"""
return ('/users/', '/profile/', '/accounts/', '/channel/', '/u/',
'/c/', '/video-channels/', '/author/', '/activitypub/',
'/actors/', '/snac/', '/@/', '/~/')
'/c/', '/m/', '/video-channels/', '/author/',
'/activitypub/', '/actors/', '/snac/', '/@/', '/~/')
def get_group_paths() -> []:
"""Returns possible group paths
e.g. https://lemmy/c/groupname
"""
return ['/c/', '/video-channels/']
return ['/c/', '/video-channels/', '/m/']
def get_domain_from_actor(actor: str) -> (str, int):

View File

@ -251,7 +251,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
url.endswith('/about'):
# ignore various peertube endpoints
continue
if '/c/' in url:
if '/c/' in url or '/m/' in url:
# don't try to embed peertube channel page
continue
if '?sort=' in url: