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
f64887e1
Commit
f64887e1
authored
10 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
Added RestServlet for /rooms/$roomid/initialSync
parent
4e8d19ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/room.py
+30
-0
30 additions, 0 deletions
synapse/rest/room.py
with
30 additions
and
0 deletions
synapse/rest/room.py
+
30
−
0
View file @
f64887e1
...
...
@@ -337,6 +337,35 @@ class RoomStateRestServlet(RestServlet):
defer
.
returnValue
((
200
,
[]))
# TODO: Needs unit testing
class
RoomInitialSyncRestServlet
(
RestServlet
):
PATTERN
=
client_path_pattern
(
"
/rooms/(?P<room_id>[^/]*)/initialSync$
"
)
@defer.inlineCallbacks
def
on_GET
(
self
,
request
,
room_id
):
user
=
yield
self
.
auth
.
get_user_by_req
(
request
)
# TODO: Get all the initial sync data for this room and return in the
# same format as initial sync, that is:
# {
# membership: join,
# messages: [
# chunk: [ msg events ],
# start: s_tok,
# end: e_tok
# ],
# room_id: foo,
# state: [
# { state event } , { state event }
# ]
# }
# Probably worth keeping the keys room_id and membership for parity with
# /initialSync even though they must be joined to sync this and know the
# room ID, so clients can reuse the same code (room_id and membership
# are MANDATORY for /initialSync, so the code will expect it to be
# there)
defer
.
returnValue
((
200
,
{}))
class
RoomTriggerBackfill
(
RestServlet
):
PATTERN
=
client_path_pattern
(
"
/rooms/(?P<room_id>[^/]*)/backfill$
"
)
...
...
@@ -452,3 +481,4 @@ def register_servlets(hs, http_server):
RoomSendEventRestServlet
(
hs
).
register
(
http_server
)
PublicRoomListRestServlet
(
hs
).
register
(
http_server
)
RoomStateRestServlet
(
hs
).
register
(
http_server
)
RoomInitialSyncRestServlet
(
hs
).
register
(
http_server
)
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