@@ -55,25 +55,17 @@ def __init__(self, hs: "HomeServer"):
5555 self .hs = hs
5656 self .auth = hs .get_auth ()
5757 self .device_handler = hs .get_device_handler ()
58- self ._msc3852_enabled = hs .config .experimental .msc3852_enabled
5958
6059 async def on_GET (self , request : SynapseRequest ) -> tuple [int , JsonDict ]:
6160 requester = await self .auth .get_user_by_req (request , allow_guest = True )
6261 devices = await self .device_handler .get_devices_by_user (
6362 requester .user .to_string ()
6463 )
6564
66- # If MSC3852 is disabled, then the "last_seen_user_agent" field will be
67- # removed from each device. If it is enabled, then the field name will
68- # be replaced by the unstable identifier.
69- #
70- # When MSC3852 is accepted, this block of code can just be removed to
71- # expose "last_seen_user_agent" to clients.
7265 for device in devices :
73- last_seen_user_agent = device ["last_seen_user_agent" ]
66+ # This field is only for admin access and should not be exposed to clients.
67+ # (MSC3852, which is closed, did propose to expose it.).
7468 del device ["last_seen_user_agent" ]
75- if self ._msc3852_enabled :
76- device ["org.matrix.msc3852.last_seen_user_agent" ] = last_seen_user_agent
7769
7870 return 200 , {"devices" : devices }
7971
@@ -144,7 +136,6 @@ def __init__(self, hs: "HomeServer"):
144136 handler = hs .get_device_handler ()
145137 self .device_handler = handler
146138 self .auth_handler = hs .get_auth_handler ()
147- self ._msc3852_enabled = hs .config .experimental .msc3852_enabled
148139 self ._auth_delegation_enabled = (
149140 hs .config .mas .enabled or hs .config .experimental .msc3861 .enabled
150141 )
@@ -159,16 +150,9 @@ async def on_GET(
159150 if device is None :
160151 raise NotFoundError ("No device found" )
161152
162- # If MSC3852 is disabled, then the "last_seen_user_agent" field will be
163- # removed from each device. If it is enabled, then the field name will
164- # be replaced by the unstable identifier.
165- #
166- # When MSC3852 is accepted, this block of code can just be removed to
167- # expose "last_seen_user_agent" to clients.
168- last_seen_user_agent = device ["last_seen_user_agent" ]
153+ # This field is only for admin access and should not be exposed to clients.
154+ # (MSC3852, which is closed, did propose to expose it.)
169155 del device ["last_seen_user_agent" ]
170- if self ._msc3852_enabled :
171- device ["org.matrix.msc3852.last_seen_user_agent" ] = last_seen_user_agent
172156
173157 return 200 , device
174158
0 commit comments