Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
97e1159a
Commit
97e1159a
authored
4 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'erikj/faster_typing' of github.com:matrix-org/synapse into develop
parents
8c7d0f16
9006e125
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/7856.misc
+1
-0
1 addition, 0 deletions
changelog.d/7856.misc
synapse/handlers/typing.py
+2
-2
2 additions, 2 deletions
synapse/handlers/typing.py
tests/handlers/test_typing.py
+2
-2
2 additions, 2 deletions
tests/handlers/test_typing.py
with
5 additions
and
4 deletions
changelog.d/7856.misc
0 → 100644
+
1
−
0
View file @
97e1159a
Small performance improvement in typing processing.
This diff is collapsed.
Click to expand it.
synapse/handlers/typing.py
+
2
−
2
View file @
97e1159a
...
...
@@ -185,7 +185,7 @@ class TypingHandler(object):
async
def
_push_remote
(
self
,
member
,
typing
):
try
:
users
=
await
self
.
st
at
e
.
get_
current_
users_in_room
(
member
.
room_id
)
users
=
await
self
.
st
or
e
.
get_users_in_room
(
member
.
room_id
)
self
.
_member_last_federation_poke
[
member
]
=
self
.
clock
.
time_msec
()
now
=
self
.
clock
.
time_msec
()
...
...
@@ -224,7 +224,7 @@ class TypingHandler(object):
)
return
users
=
await
self
.
st
at
e
.
get_
current_
users_in_room
(
room_id
)
users
=
await
self
.
st
or
e
.
get_users_in_room
(
room_id
)
domains
=
{
get_domain_from_id
(
u
)
for
u
in
users
}
if
self
.
server_name
in
domains
:
...
...
This diff is collapsed.
Click to expand it.
tests/handlers/test_typing.py
+
2
−
2
View file @
97e1159a
...
...
@@ -138,10 +138,10 @@ class TypingNotificationsTestCase(unittest.HomeserverTestCase):
self
.
datastore
.
get_joined_hosts_for_room
=
get_joined_hosts_for_room
def
get_
current_
users_in_room
(
room_id
):
def
get_users_in_room
(
room_id
):
return
defer
.
succeed
({
str
(
u
)
for
u
in
self
.
room_members
})
hs
.
get_state_handler
().
get_curren
t_users_in_room
=
get_
current_
users_in_room
self
.
datastore
.
ge
t_users_in_room
=
get_users_in_room
self
.
datastore
.
get_user_directory_stream_pos
.
return_value
=
(
# we deliberately return a non-None stream pos to avoid doing an initial_spam
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment