Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
5eda0185
Unverified
Commit
5eda0185
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Properly handle presence events for application services. (#8656)
parent
437a99fb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/8656.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/8656.bugfix
synapse/handlers/appservice.py
+5
-4
5 additions, 4 deletions
synapse/handlers/appservice.py
with
6 additions
and
4 deletions
changelog.d/8656.bugfix
0 → 100644
+
1
−
0
View file @
5eda0185
Fix a bug introduced in v1.22.0rc1 where presence events were not properly passed to application services.
This diff is collapsed.
Click to expand it.
synapse/handlers/appservice.py
+
5
−
4
View file @
5eda0185
...
@@ -238,7 +238,7 @@ class ApplicationServicesHandler:
...
@@ -238,7 +238,7 @@ class ApplicationServicesHandler:
async
def
_handle_presence
(
async
def
_handle_presence
(
self
,
service
:
ApplicationService
,
users
:
Collection
[
UserID
]
self
,
service
:
ApplicationService
,
users
:
Collection
[
UserID
]
):
)
->
List
[
JsonDict
]
:
events
=
[]
# type: List[JsonDict]
events
=
[]
# type: List[JsonDict]
presence_source
=
self
.
event_sources
.
sources
[
"
presence
"
]
presence_source
=
self
.
event_sources
.
sources
[
"
presence
"
]
from_key
=
await
self
.
store
.
get_type_stream_id_for_appservice
(
from_key
=
await
self
.
store
.
get_type_stream_id_for_appservice
(
...
@@ -252,7 +252,7 @@ class ApplicationServicesHandler:
...
@@ -252,7 +252,7 @@ class ApplicationServicesHandler:
user
=
user
,
service
=
service
,
from_key
=
from_key
,
user
=
user
,
service
=
service
,
from_key
=
from_key
,
)
)
time_now
=
self
.
clock
.
time_msec
()
time_now
=
self
.
clock
.
time_msec
()
presence_events
=
[
events
.
extend
(
{
{
"
type
"
:
"
m.presence
"
,
"
type
"
:
"
m.presence
"
,
"
sender
"
:
event
.
user_id
,
"
sender
"
:
event
.
user_id
,
...
@@ -261,8 +261,9 @@ class ApplicationServicesHandler:
...
@@ -261,8 +261,9 @@ class ApplicationServicesHandler:
),
),
}
}
for
event
in
presence_events
for
event
in
presence_events
]
)
events
=
events
+
presence_events
return
events
async
def
query_user_exists
(
self
,
user_id
):
async
def
query_user_exists
(
self
,
user_id
):
"""
Check if any application service knows this user_id exists.
"""
Check if any application service knows this user_id exists.
...
...
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