DFSDJFDSLKF

This commit is contained in:
Erik Johnston 2020-03-24 17:27:50 +00:00
parent 604f57f1bd
commit 9ea391054f
4 changed files with 19 additions and 13 deletions

View file

@ -105,6 +105,7 @@ from synapse.rest.client.v1.room import (
RoomSendEventRestServlet,
RoomStateEventRestServlet,
RoomStateRestServlet,
RoomTypingRestServlet,
)
from synapse.rest.client.v1.voip import VoipRestServlet
from synapse.rest.client.v2_alpha import groups, sync, user_directory
@ -464,6 +465,7 @@ class GenericWorkerServer(HomeServer):
ProfileDisplaynameRestServlet(self).register(resource)
ProfileRestServlet(self).register(resource)
KeyUploadServlet(self).register(resource)
RoomTypingRestServlet(self).register(resource)
sync.register_servlets(self, resource)
events.register_servlets(self, resource)
@ -892,6 +894,8 @@ def start(config_options):
config.send_federation = True
config.server.handle_typing = False
if config.worker_app == "synapse.app.client_reader":
config.server.handle_typing = True
synapse.events.USE_FROZEN_DICTS = config.use_frozen_dicts
@ -908,6 +912,8 @@ def start(config_options):
"before", "startup", _base.start, ss, config.worker_listeners
)
ss.get_replication_streamer()
_base.start_worker_reactor("synapse-generic-worker", config)

View file

@ -56,7 +56,7 @@ class TypingHandler(object):
self.clock = hs.get_clock()
self.wheel_timer = WheelTimer(bucket_size=5000)
self.federation = hs.get_federation_sender()
# self.federation = hs.get_federation_sender()
hs.get_federation_registry().register_edu_handler("m.typing", self._recv_edu)
@ -203,16 +203,16 @@ class TypingHandler(object):
for domain in {get_domain_from_id(u) for u in users}:
if domain != self.server_name:
logger.debug("sending typing update to %s", domain)
self.federation.build_and_send_edu(
destination=domain,
edu_type="m.typing",
content={
"room_id": member.room_id,
"user_id": member.user_id,
"typing": typing,
},
key=member,
)
# self.federation.build_and_send_edu(
# destination=domain,
# edu_type="m.typing",
# content={
# "room_id": member.room_id,
# "user_id": member.user_id,
# "typing": typing,
# },
# key=member,
# )
except Exception:
logger.exception("Error pushing typing notif to remotes")

View file

@ -218,7 +218,7 @@ class ReplicationClientHandler:
rows: a list of Stream.ROW_TYPE objects as returned by
Stream.parse_row.
"""
logger.debug("Received rdata %s -> %s", stream_name, token)
logger.info("Received rdata %s -> %s", stream_name, token)
await self.replication_data_handler.on_rdata(stream_name, token, rows)
async def on_POSITION(self, cmd: PositionCommand):

View file

@ -816,7 +816,7 @@ class RoomTypingRestServlet(RestServlet):
content = parse_json_object_from_request(request)
await self.presence_handler.bump_presence_active_time(requester.user)
# await self.presence_handler.bump_presence_active_time(requester.user)
# Limit timeout to stop people from setting silly typing timeouts.
timeout = min(content.get("timeout", 30000), 120000)