David Robertson
1026776380
mypy plugin to check `@cached` return types ( #14911 )
Co-authored-by: David Robertson <davidr@element.io>
Co-authored-by: Patrick Cloke <patrickc@matrix.org>
Co-authored-by: Erik Johnston <erik@matrix.org>
Assert that the return type of callables wrapped in @cached
and @cachedList are cachable (aka immutable).
pirms 7 mēnešiem
Šimon Brandner
583f22780f
Use stable prefixes for MSC3827: filtering of `/publicRooms` by room type ( #13370 )
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pirms 1 gada
Šimon Brandner
13e359aec8
Implement MSC3827: Filtering of `/publicRooms` by room type ( #13031 )
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pirms 1 gada
Erik Johnston
888a29f412
Wait for lazy join to complete when getting current state ( #12872 )
pirms 1 gada
Richard van der Hoff
e24ff8ebe3
Remove `HomeServer.get_datastore()` ( #12031 )
The presence of this method was confusing, and mostly present for backwards
compatibility. Let's get rid of it.
Part of #11733
pirms 2 gadiem
Patrick Cloke
cbd82d0b2d
Convert all namedtuples to attrs. ( #11665 )
To improve type hints throughout the code.
pirms 2 gadiem
Patrick Cloke
eb9ddc8c2e
Remove the deprecated BaseHandler. ( #11005 )
The shared ratelimit function was replaced with a dedicated
RequestRatelimiter class (accessible from the HomeServer
object).
Other properties were copied to each sub-class that inherited
from BaseHandler.
pirms 2 gadiem
Patrick Cloke
bb7fdd821b
Use direct references for configuration variables (part 5). ( #10897 )
pirms 2 gadiem
Patrick Cloke
b3590614da
Require type hints in the handlers module. ( #10831 )
Adds missing type hints to methods in the synapse.handlers
module and requires all methods to have type hints there.
This also removes the unused construct_auth_difference method
from the FederationHandler.
pirms 2 gadiem
Patrick Cloke
0288e6033b
Add a constant for m.federate. ( #10775 )
pirms 2 gadiem
Richard van der Hoff
56e2a30634
Move `maybe_kick_guest_users` out of `BaseHandler` ( #10744 )
This is part of my ongoing war against BaseHandler. I've moved kick_guest_users into RoomMemberHandler (since it calls out to that handler anyway), and split maybe_kick_guest_users into the two places it is called.
pirms 2 gadiem
Erik Johnston
60f0534b6e
Fix exceptions in logs when failing to get remote room list ( #10541 )
pirms 2 gadiem
Erik Johnston
f3ac9c6750
Fix exception when failing to get remote room list ( #10414 )
pirms 2 gadiem
Jonathan de Jong
98aec1cc9d
Use inline type hints in `handlers/` and `rest/`. ( #10382 )
pirms 2 gadiem
Erik Johnston
7695ca0618
Fix a number of logged errors caused by remote servers being down. ( #10400 )
pirms 2 gadiem
Andrew Morgan
a7a37437bc
Integrate knock rooms with the public rooms directory ( #9359 )
This PR implements the ["Changes regarding the Public Rooms Directory"](https://github.com/Sorunome/matrix-doc/blob/soru/knock/proposals/2403-knock.md#changes-regarding-the-public-rooms-directory ) section of knocking MSC2403.
Specifically, it:
* Allows rooms with `join_rule` "knock" to be returned by the query behind the public rooms directory
* Adds the field `join_rule` to each room entry returned by a public rooms directory query, so clients can know whether to attempt a join or knock on a room
Based on https://github.com/matrix-org/synapse/issues/6739 . Complement tests for this change: https://github.com/matrix-org/complement/pull/72
pirms 2 gadiem
Patrick Cloke
c7f3fb2745
Add type hints to the federation server transport. ( #10080 )
pirms 2 gadiem
Jonathan de Jong
4b965c862d
Remove redundant "coding: utf-8" lines ( #9786 )
Part of #9744
Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now.
`Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
pirms 3 gadiem
Patrick Cloke
b7748d3c00
Import HomeServer from the proper module. ( #9665 )
pirms 3 gadiem
Jonathan de Jong
d6196efafc
Add ResponseCache tests. ( #9458 )
pirms 3 gadiem
Patrick Cloke
9999eb2d02
Add type hints to admin and room list handlers. ( #8973 )
pirms 3 gadiem
Patrick Cloke
be2db93b3c
Do not assume that the contents dictionary includes history_visibility. ( #8945 )
pirms 3 gadiem
Patrick Cloke
8a4a4186de
Simplify super() calls to Python 3 syntax. ( #8344 )
This converts calls like super(Foo, self) -> super().
Generated with:
sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
pirms 3 gadiem
Patrick Cloke
de119063f2
Convert room list handler to async/await. ( #7912 )
pirms 3 gadiem
Patrick Cloke
bd6dc17221
Replace iteritems/itervalues/iterkeys with native versions. ( #7692 )
pirms 3 gadiem
Erik Johnston
cb495f526d
Fix 'FederationGroupsRoomsServlet' API when group has room server is not in. ( #7599 )
pirms 4 gadiem
Andrew Morgan
9d8ecc9e6c
Apply federation check for /publicRooms with filter list ( #7367 )
pirms 4 gadiem
Andrew Morgan
b21000a44f
Improve error responses when a remote server doesn't allow you to access its public rooms list ( #6899 )
pirms 4 gadiem
Patrick Cloke
fcf4599488
Stop returning aliases as part of the room list. ( #6970 )
pirms 4 gadiem
Andrew Morgan
ea7d938bca
Remove unused public room list timeout param ( #6179 )
* Remove unused public room list timeout param
* Add changelog
pirms 4 gadiem
Erik Johnston
03cf4385e0
Fix public room list pagination.
We incorrectly used `room_id` as to bound the result set, even though we
order by `joined_members, room_id`, leading to incorrect results after
pagination.
pirms 4 gadiem
Erik Johnston
a5166e4d5f
Land improved room list based on room stats ( #6019 )
Use room_stats and room_state for room directory search
pirms 4 gadiem
Olivier Wilkinson (reivilibre)
6fadb560fc
Support MSC2197 outbound with unstable prefix
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
pirms 4 gadiem
Amber Brown
4806651744
Replace returnValue with return ( #5736 )
pirms 4 gadiem
Amber Brown
32e7c9e7f2
Run Black. ( #5482 )
pirms 4 gadiem
Andrew Morgan
4a4d5c4fd6
Fix grammar and document get_current_users_in_room ( #4998 )
pirms 5 gadiem
Erik Johnston
2c90422146
Pull out config option
pirms 5 gadiem
Erik Johnston
7529038e66
Return before we log
pirms 5 gadiem
Erik Johnston
213c98c00a
Add option to disable search room lists
This disables both local and remote room list searching.
pirms 5 gadiem
Andrew Morgan
6fcb25202f
Put function def back to the way it was
pirms 5 gadiem
Andrew Morgan
7a4632af9c
Prevent showing non-fed rooms in fed /publicRooms
pirms 5 gadiem
Andrew Morgan
c74624a633
Revert "Prevent showing non-fed rooms in fed /publicRooms"
pirms 5 gadiem
Andrew Morgan
c4414768af
Cleaner chunk logic
pirms 5 gadiem
Andrew Morgan
a712aa3a9c
Correct indent
pirms 5 gadiem
Andrew Morgan
16565e67db
Correct docstring types and chunk logic
pirms 5 gadiem
Andrew Morgan
40c2271680
Clean up room chunk logic
pirms 5 gadiem
Andrew Morgan
6728bf3940
Make not showing non-federated rooms the default
pirms 5 gadiem
Andrew Morgan
6946c20111
Result may be None
pirms 5 gadiem
Andrew Morgan
71669a0fba
Address rich comments
pirms 5 gadiem
Andrew Morgan
1330aa4a8f
elif not else if
pirms 5 gadiem