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
Container Registry
Model registry
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
Maunium
synapse
Commits
9c850d9d
Commit
9c850d9d
authored
6 years ago
by
Neil Johnson
Browse files
Options
Downloads
Patches
Plain Diff
formatting and use constants where available
parent
2f468040
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/client/v2_alpha/capabilities.py
+17
-19
17 additions, 19 deletions
synapse/rest/client/v2_alpha/capabilities.py
with
17 additions
and
19 deletions
synapse/rest/client/v2_alpha/capabilities.py
+
17
−
19
View file @
9c850d9d
...
@@ -16,7 +16,8 @@ import logging
...
@@ -16,7 +16,8 @@ import logging
from
twisted.internet
import
defer
from
twisted.internet
import
defer
from
synapse.api.constants
import
DEFAULT_ROOM_VERSION
from
synapse.api.constants
import
DEFAULT_ROOM_VERSION
,
RoomVersions
,
RoomDisposition
from
synapse.http.servlet
import
RestServlet
from
synapse.http.servlet
import
RestServlet
from
._base
import
client_v2_patterns
from
._base
import
client_v2_patterns
...
@@ -43,26 +44,23 @@ class CapabilitiesRestServlet(RestServlet):
...
@@ -43,26 +44,23 @@ class CapabilitiesRestServlet(RestServlet):
def
on_GET
(
self
,
request
):
def
on_GET
(
self
,
request
):
requester
=
yield
self
.
auth
.
get_user_by_req
(
request
,
allow_guest
=
True
)
requester
=
yield
self
.
auth
.
get_user_by_req
(
request
,
allow_guest
=
True
)
user
=
yield
self
.
store
.
get_user_by_id
(
requester
.
user
.
to_string
())
user
=
yield
self
.
store
.
get_user_by_id
(
requester
.
user
.
to_string
())
change_password
=
bool
(
user
[
'
password_hash
'
])
change_password
=
bool
(
user
[
"
password_hash
"
])
defer
.
returnValue
(
response
=
{
(
200
,
{
"
capabilities
"
:
{
"
capabilities
"
:
{
"
m.room_versions
"
:
{
"
m.room_versions
"
:
{
"
default
"
:
DEFAULT_ROOM_VERSION
,
"
default
"
:
DEFAULT_ROOM_VERSION
,
"
available
"
:
{
"
available
"
:
{
RoomVersions
.
V1
:
RoomDisposition
.
STABLE
,
"
1
"
:
"
stable
"
,
RoomVersions
.
V2
:
RoomDisposition
.
STABLE
,
"
2
"
:
"
stable
"
,
RoomVersions
.
STATE_V2_TEST
:
RoomDisposition
.
UNSTABLE
,
"
state-v2-test
"
:
"
unstable
"
,
RoomVersions
.
V3
:
RoomDisposition
.
STABLE
,
"
3
"
:
"
stable
"
,
}
},
"
m.change_password
"
:
{
"
enabled
"
:
change_password
,
},
},
}
},
})
"
m.change_password
"
:
{
"
enabled
"
:
change_password
},
)
}
}
defer
.
returnValue
((
200
,
response
))
def
register_servlets
(
hs
,
http_server
):
def
register_servlets
(
hs
,
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