mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-20 15:34:38 -04:00
Add is_guest flag to users db to track whether a user is a guest user or not. Use this so we can run _filter_events_for_client when calculating event_push_actions.
This commit is contained in:
parent
eb03625626
commit
c79f221192
9 changed files with 69 additions and 31 deletions
|
@ -23,8 +23,6 @@ from synapse.push.action_generator import ActionGenerator
|
|||
|
||||
from synapse.util.logcontext import PreserveLoggingContext
|
||||
|
||||
from synapse.events.utils import serialize_event
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
|
@ -256,9 +254,9 @@ class BaseHandler(object):
|
|||
)
|
||||
|
||||
action_generator = ActionGenerator(self.store)
|
||||
yield action_generator.handle_push_actions_for_event(serialize_event(
|
||||
event, self.clock.time_msec()
|
||||
))
|
||||
yield action_generator.handle_push_actions_for_event(
|
||||
event, self
|
||||
)
|
||||
|
||||
destinations = set(extra_destinations)
|
||||
for k, s in context.current_state.items():
|
||||
|
|
|
@ -32,7 +32,7 @@ from synapse.crypto.event_signing import (
|
|||
)
|
||||
from synapse.types import UserID
|
||||
|
||||
from synapse.events.utils import prune_event, serialize_event
|
||||
from synapse.events.utils import prune_event
|
||||
|
||||
from synapse.util.retryutils import NotRetryingDestination
|
||||
|
||||
|
@ -246,8 +246,8 @@ class FederationHandler(BaseHandler):
|
|||
|
||||
if not backfilled and not event.internal_metadata.is_outlier():
|
||||
action_generator = ActionGenerator(self.store)
|
||||
yield action_generator.handle_push_actions_for_event(serialize_event(
|
||||
event, self.clock.time_msec())
|
||||
yield action_generator.handle_push_actions_for_event(
|
||||
event, self
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
@ -84,7 +84,8 @@ class RegistrationHandler(BaseHandler):
|
|||
localpart=None,
|
||||
password=None,
|
||||
generate_token=True,
|
||||
guest_access_token=None
|
||||
guest_access_token=None,
|
||||
make_guest=False
|
||||
):
|
||||
"""Registers a new client on the server.
|
||||
|
||||
|
@ -118,6 +119,7 @@ class RegistrationHandler(BaseHandler):
|
|||
token=token,
|
||||
password_hash=password_hash,
|
||||
was_guest=guest_access_token is not None,
|
||||
make_guest=make_guest
|
||||
)
|
||||
|
||||
yield registered_user(self.distributor, user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue