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
9c49054f
Commit
9c49054f
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor
parents
f280929a
67c95856
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/media/v1/media_repository.py
+1
-1
1 addition, 1 deletion
synapse/media/v1/media_repository.py
synapse/notifier.py
+25
-7
25 additions, 7 deletions
synapse/notifier.py
with
26 additions
and
8 deletions
synapse/media/v1/media_repository.py
+
1
−
1
View file @
9c49054f
...
@@ -39,7 +39,7 @@ class MediaRepositoryResource(Resource):
...
@@ -39,7 +39,7 @@ class MediaRepositoryResource(Resource):
<= HTTP/1.1 200 OK
<= HTTP/1.1 200 OK
Content-Type: application/json
Content-Type: application/json
{
"
content
-
uri
"
:
"
mxc://<server-name>/<media-id>
"
}
{
"
content
_
uri
"
:
"
mxc://<server-name>/<media-id>
"
}
=> GET /_matrix/media/v1/download/<server-name>/<media-id> HTTP/1.1
=> GET /_matrix/media/v1/download/<server-name>/<media-id> HTTP/1.1
...
...
This diff is collapsed.
Click to expand it.
synapse/notifier.py
+
25
−
7
View file @
9c49054f
...
@@ -146,7 +146,11 @@ class Notifier(object):
...
@@ -146,7 +146,11 @@ class Notifier(object):
Will wake up all listeners for the given users and rooms.
Will wake up all listeners for the given users and rooms.
"""
"""
yield
run_on_reactor
()
yield
run_on_reactor
()
# TODO(paul): This is horrible, having to manually list every event
# source here individually
presence_source
=
self
.
event_sources
.
sources
[
"
presence
"
]
presence_source
=
self
.
event_sources
.
sources
[
"
presence
"
]
typing_source
=
self
.
event_sources
.
sources
[
"
typing
"
]
listeners
=
set
()
listeners
=
set
()
...
@@ -158,19 +162,33 @@ class Notifier(object):
...
@@ -158,19 +162,33 @@ class Notifier(object):
@defer.inlineCallbacks
@defer.inlineCallbacks
def
notify
(
listener
):
def
notify
(
listener
):
events
,
end_key
=
yield
presence_source
.
get_new_events_for_user
(
presence_events
,
presence_end_key
=
(
listener
.
user
,
yield
presence_source
.
get_new_events_for_user
(
listener
.
from_token
.
presence_key
,
listener
.
user
,
listener
.
limit
,
listener
.
from_token
.
presence_key
,
listener
.
limit
,
)
)
typing_events
,
typing_end_key
=
(
yield
typing_source
.
get_new_events_for_user
(
listener
.
user
,
listener
.
from_token
.
typing_key
,
listener
.
limit
,
)
)
)
if
events
:
if
presence_events
or
typing_
events
:
end_token
=
listener
.
from_token
.
copy_and_replace
(
end_token
=
listener
.
from_token
.
copy_and_replace
(
"
presence_key
"
,
end_key
"
presence_key
"
,
presence_end_key
).
copy_and_replace
(
"
typing_key
"
,
typing_end_key
)
)
listener
.
notify
(
listener
.
notify
(
self
,
events
,
listener
.
from_token
,
end_token
self
,
presence_events
+
typing_events
,
listener
.
from_token
,
end_token
)
)
def
eb
(
failure
):
def
eb
(
failure
):
...
...
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