mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-23 05:00:24 +03:00
DFSDJFDSLKF
This commit is contained in:
parent
604f57f1bd
commit
9ea391054f
4 changed files with 19 additions and 13 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue