diff --git a/models.py b/models.py index 84bf3e49..e6e4c44d 100644 --- a/models.py +++ b/models.py @@ -191,12 +191,6 @@ class User(StringIdModel, metaclass=ProtocolUserMeta): # TODO: switch to using Object.copies on the user profile object? copies = ndb.StructuredProperty(Target, repeated=True) - # whether this user signed up or otherwise explicitly, deliberately - # interacted with Bridgy Fed. For example, if fediverse user @a@b.com looks - # up @foo.com@fed.brid.gy via WebFinger, we'll create Users for both, - # @a@b.com will be direct, foo.com will not. - direct = ndb.BooleanProperty(default=False) - # these are for ActivityPub HTTP Signatures public_exponent = ndb.StringProperty() private_exponent = ndb.StringProperty() @@ -219,6 +213,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta): # `existing` attr is set by get_or_create # OLD. some stored entities still have these; do not reuse. + # direct = ndb.BooleanProperty(default=False) # actor_as2 = JsonProperty() # protocol-specific state # atproto_notifs_indexed_at = ndb.TextProperty() @@ -310,11 +305,10 @@ def _run(): # TODO: propagate more fields? changed = False - for field in ['direct', 'obj', 'obj_key']: + for field in ['obj', 'obj_key']: old_val = getattr(user, field, None) new_val = kwargs.get(field) - if ((old_val is None and new_val is not None) - or (field == 'direct' and not old_val and new_val)): + if old_val is None and new_val is not None: setattr(user, field, new_val) changed = True diff --git a/pages.py b/pages.py index 4192184c..904a71b7 100644 --- a/pages.py +++ b/pages.py @@ -84,8 +84,8 @@ def load_user(protocol, id): elif user and id != user.key.id(): # use_instead redirect error('', status=302, location=user.user_page_path()) - if (user and not user.status - and (user.direct or user.enabled_protocols or cls.ABBREV == 'web')): + if user and not user.status and (user.enabled_protocols + or user.DEFAULT_ENABLED_PROTOCOLS): assert not user.use_instead return user diff --git a/protocol.py b/protocol.py index 5c5953e1..f4169472 100644 --- a/protocol.py +++ b/protocol.py @@ -1102,10 +1102,7 @@ def handle_follow(from_cls, obj): logger.info(f'Skipping invalid {from_cls.LABEL} user key: {from_id}') continue - # If followee user is already direct, follower may not know they're - # interacting with a bridge. if followee user is indirect though, - # follower should know, so they're direct. - to_user = to_cls.get_or_create(id=to_key.id(), obj=to_obj, direct=False, + to_user = to_cls.get_or_create(id=to_key.id(), obj=to_obj, allow_opt_out=True) follower_obj = Follower.get_or_create(to=to_user, from_=from_user, follow=obj.key, status='active') diff --git a/redirect.py b/redirect.py index fe91d2a3..eb586746 100644 --- a/redirect.py +++ b/redirect.py @@ -109,11 +109,8 @@ def redir(to): if not obj or obj.deleted: return f'Object not found: {to}', 404 - # TODO: do this for other protocols too? if proto == Web and not web_user: - web_user = Web.get_or_create(util.domain_from_link(to), direct=False, obj=obj) - if not web_user: - return f'Object not found: {to}', 404 + return f'Object not found: {to}', 404 ret = ActivityPub.convert(obj, from_user=web_user) # logger.info(f'Returning: {json_dumps(ret, indent=2)}') diff --git a/templates/docs.html b/templates/docs.html index 37ef6f22..23a65510 100644 --- a/templates/docs.html +++ b/templates/docs.html @@ -428,7 +428,7 @@
You can follow any web site, eg example.com, by searching for @example.com@web.brid.gy in your fediverse instance.
+To follow a web site, first enter it here to make sure it's set up, then wait a minute, then search for @[domain]@web.brid.gy
in your fediverse instance. For example, to follow nature.com, search for @nature.com@web.brid.gy
.
Bridged web sites appear in the fediverse as either @[domain]@[domain]
, @[domain]@web.brid.gy
, or @[domain]@fed.brid.gy
, depending on the fediverse server and whether the web site owner has connected their domain to Bridgy Fed. All bridged web sites behave the same in the fediverse; the different instances in their handles are purely cosmetic.
To follow a web site, first enter it here to make sure it's set up, then wait a minute, then search for it in Bluesky as [domain].web.brid.gy
. For example, nature.com is bridged into Bluesky as nature.com.web.brid.gy.
To follow a web site, first enter it here to make sure it's set up, then wait a minute, then search for it in Bluesky as [domain].web.brid.gy
. For example, nature.com is bridged into Bluesky as nature.com.web.brid.gy.
What's your web site?
+Enter a web site to bridge: