Skip to content

Commit

Permalink
UserId to ActorURI mapping both directions for WordPress. Fixes fediv…
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Ernst committed Aug 2, 2024
1 parent 9b9061b commit a989cb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/feditest/nodedrivers/wordpress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class WordPressPlusActivityPubPluginNode(NodeWithMastodonAPI):
"""
# implementation override -- WordPress has a different scheme than Mastodon
def _userid_to_actor_uri(self, userid: str) -> str:
return f'https://{ self.parameter("hostname") }/author/{ userid }'
return f'https://{ self.parameter("hostname") }/author/{ userid }/'


# implementation override -- WordPress has a different scheme than Mastodon
def _actor_uri_to_userid(self, actor_uri: str) -> str:
if m:= re.match('^https://([^/]+)/author/(.+)$', actor_uri):
if m:= re.match('^https://([^/]+)/author/([^/]+)/?$', actor_uri):
if m.group(1) == self.parameter('hostname'):
return m.group(2)

Expand Down

0 comments on commit a989cb6

Please sign in to comment.