kopia lustrzana https://github.com/snarfed/bridgy-fed
oops, need to implement Web.profile_id after all
Web user ids are domains, eg user.com, but "web id" of a user profile is a full homepage url, eg https://user.com/pull/646/head
rodzic
325f8b3931
commit
6a951138dc
|
@ -1913,6 +1913,9 @@ class WebUtilTest(TestCase):
|
||||||
def test_handle_to_id(self, *_):
|
def test_handle_to_id(self, *_):
|
||||||
self.assertEqual('foo.com', Web.handle_to_id('foo.com'))
|
self.assertEqual('foo.com', Web.handle_to_id('foo.com'))
|
||||||
|
|
||||||
|
def test_profile_id(self, *_):
|
||||||
|
self.assertEqual('https://foo.com/', Web(id='foo.com').profile_id())
|
||||||
|
|
||||||
def test_fetch(self, mock_get, __):
|
def test_fetch(self, mock_get, __):
|
||||||
mock_get.return_value = REPOST
|
mock_get.return_value = REPOST
|
||||||
|
|
||||||
|
|
2
web.py
2
web.py
|
@ -104,6 +104,8 @@ class Web(User, Protocol):
|
||||||
"""Returns this user's web URL aka web_url, eg 'https://foo.com/'."""
|
"""Returns this user's web URL aka web_url, eg 'https://foo.com/'."""
|
||||||
return f'https://{self.key.id()}/'
|
return f'https://{self.key.id()}/'
|
||||||
|
|
||||||
|
profile_id = web_url
|
||||||
|
|
||||||
def ap_address(self):
|
def ap_address(self):
|
||||||
"""Returns this user's ActivityPub address, eg '@foo.com@foo.com'.
|
"""Returns this user's ActivityPub address, eg '@foo.com@foo.com'.
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue