Skip to content
Snippets Groups Projects
Unverified Commit 19bd9cff authored by Travis Ralston's avatar Travis Ralston Committed by GitHub
Browse files

Use stable MSC3069 `is_guest` flag on `/whoami`. (#12021)

Keeping backwards compatibility with the unstable flag for now.
parent 5a691159
No related branches found
No related tags found
No related merge requests found
Support only the stable identifier for [MSC3069](https://github.com/matrix-org/matrix-doc/pull/3069)'s `is_guest` on `/_matrix/client/v3/account/whoami`.
\ No newline at end of file
......@@ -883,7 +883,9 @@ class WhoamiRestServlet(RestServlet):
response = {
"user_id": requester.user.to_string(),
# MSC: https://github.com/matrix-org/matrix-doc/pull/3069
# Entered spec in Matrix 1.2
"org.matrix.msc3069.is_guest": bool(requester.is_guest),
"is_guest": bool(requester.is_guest),
}
# Appservices and similar accounts do not have device IDs
......
......@@ -486,8 +486,9 @@ class WhoamiTestCase(unittest.HomeserverTestCase):
{
"user_id": user_id,
"device_id": device_id,
# Unstable until MSC3069 enters spec
# MSC3069 entered spec in Matrix 1.2 but maintained compatibility
"org.matrix.msc3069.is_guest": False,
"is_guest": False,
},
)
......@@ -505,8 +506,9 @@ class WhoamiTestCase(unittest.HomeserverTestCase):
{
"user_id": user_id,
"device_id": device_id,
# Unstable until MSC3069 enters spec
# MSC3069 entered spec in Matrix 1.2 but maintained compatibility
"org.matrix.msc3069.is_guest": True,
"is_guest": True,
},
)
......@@ -528,8 +530,9 @@ class WhoamiTestCase(unittest.HomeserverTestCase):
whoami,
{
"user_id": user_id,
# Unstable until MSC3069 enters spec
# MSC3069 entered spec in Matrix 1.2 but maintained compatibility
"org.matrix.msc3069.is_guest": False,
"is_guest": False,
},
)
self.assertFalse(hasattr(whoami, "device_id"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment