Additional group user path

merge-requests/30/head
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: elif '/c/' in argb.followers:
nickname = argb.followers.split('/c/')[1] nickname = argb.followers.split('/c/')[1]
nickname = remove_eol(nickname) 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: else:
# format: @nick@domain # format: @nick@domain
if '@' not in argb.followers: 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('/author/', '/actor/')
person_url = person_url.replace('/u/', '/actor/') person_url = person_url.replace('/u/', '/actor/')
person_url = person_url.replace('/c/', '/actor/') person_url = person_url.replace('/c/', '/actor/')
person_url = person_url.replace('/m/', '/actor/')
if not person_url: if not person_url:
# try single user instance # try single user instance
person_url = http_prefix + '://' + domain person_url = http_prefix + '://' + domain

View File

@ -1443,15 +1443,15 @@ def get_user_paths() -> []:
e.g. /users/nickname, /channel/nickname e.g. /users/nickname, /channel/nickname
""" """
return ('/users/', '/profile/', '/accounts/', '/channel/', '/u/', return ('/users/', '/profile/', '/accounts/', '/channel/', '/u/',
'/c/', '/video-channels/', '/author/', '/activitypub/', '/c/', '/m/', '/video-channels/', '/author/',
'/actors/', '/snac/', '/@/', '/~/') '/activitypub/', '/actors/', '/snac/', '/@/', '/~/')
def get_group_paths() -> []: def get_group_paths() -> []:
"""Returns possible group paths """Returns possible group paths
e.g. https://lemmy/c/groupname e.g. https://lemmy/c/groupname
""" """
return ['/c/', '/video-channels/'] return ['/c/', '/video-channels/', '/m/']
def get_domain_from_actor(actor: str) -> (str, int): 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'): url.endswith('/about'):
# ignore various peertube endpoints # ignore various peertube endpoints
continue continue
if '/c/' in url: if '/c/' in url or '/m/' in url:
# don't try to embed peertube channel page # don't try to embed peertube channel page
continue continue
if '?sort=' in url: if '?sort=' in url: