summary refs log tree commit diff
path: root/synapse/storage/databases/main/room.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fixes to MSC3787 implementation (#12858)David Robertson2022-05-241-18/+17
|
* Prevent expired events from being filtered out when retention is disabled ↵Brendan Abolivier2022-05-231-20/+25
| | | | | | (#12611) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Resync state after partial-state join (#12394)Richard van der Hoff2022-04-121-0/+31
| | | | | We work through all the events with partial state, updating the state at each of them. Once it's done, we recalculate the state for the whole room, and then mark the room as having complete state.
* Add some type hints to datastore. (#12255)Dirk Klimpel2022-03-281-1/+2
|
* Faster joins: persist to database (#12012)Richard van der Hoff2022-03-011-0/+37
| | | | | | | | | | | | When we get a partial_state response from send_join, store information in the database about it: * store a record about the room as a whole having partial state, and stash the list of member servers too. * flag the join event itself as having partial state * also, for any new events whose prev-events are partial-stated, note that they will *also* be partial-stated. We don't yet make any attempt to interpret this data, so API calls (and a bunch of other things) are just going to get incorrect data.
* remote join processing: get create event from state, not auth_chain (#12039)Richard van der Hoff2022-02-211-2/+2
| | | A follow-up to #12005, in which I apparently missed that there are a bunch of other places that assume the create event is in the auth chain.
* Make pagination of rooms in admin api stable (#11737)Daniel Sonck2022-01-171-9/+9
| | | | | | | | | | | | | | Always add state.room_id after the configurable ORDER BY. Otherwise, for any sort, certain pages can contain results from other pages. (Especially when sorting by creator, since there may be many rooms by the same creator) * Document different order direction of numerical fields "joined_members", "joined_local_members", "version" and "state_events" are ordered in descending direction by default (dir=f). Added a note in tests to explain the differences in ordering. Signed-off-by: Daniël Sonck <daniel@sonck.nl>
* Convert all namedtuples to attrs. (#11665)Patrick Cloke2021-12-301-6/+20
| | | To improve type hints throughout the code.
* Add type hints to `synapse/storage/databases/main/room.py` (#11575)Sean Quah2021-12-151-73/+100
|
* Remove redundant `COALESCE()`s around `COUNT()`s in database queries (#11570)Sean Quah2021-12-141-1/+1
| | | | | `COUNT()` never returns `NULL`. A `COUNT(*)` over 0 rows is 0 and a `COUNT(NULL)` is also 0.
* Type hint the constructors of the data store classes (#11555)Sean Quah2021-12-131-4/+23
|
* Add dedicated admin API for blocking a room (#11324)Dirk Klimpel2021-11-181-0/+32
|
* Allow admins to proactively block rooms (#11228)David Robertson2021-11-091-1/+6
| | | | Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add search by room ID and room alias to List Room admin API (#11099)Dirk Klimpel2021-11-021-11/+18
| | | | Fixes: #10874 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add type hints for most `HomeServer` parameters (#11095)Sean Quah2021-10-221-4/+7
|
* Move experimental & retention config out of the server module. (#11070)Patrick Cloke2021-10-151-4/+4
|
* Use direct references for configuration variables (part 6). (#10916)Patrick Cloke2021-09-291-4/+4
|
* Use direct references for some configuration variables (#10798)Patrick Cloke2021-09-131-1/+1
| | | | Instead of proxying through the magic getter of the RootConfig object. This should be more performant (and is more explicit).
* Populate `rooms.creator` field for easy lookup (#10697)Eric Eastwood2021-09-011-4/+93
| | | | | | Part of https://github.com/matrix-org/synapse/pull/10566 - Fill in creator whenever we insert into the rooms table - Add background update to backfill any missing creator values
* Allow /createRoom to be run on workers (#10564)Andrew Morgan2021-08-171-34/+34
| | | Fixes https://github.com/matrix-org/synapse/issues/7867
* Remove the unused public_room_list_stream (#10565)Andrew Morgan2021-08-171-177/+38
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add a return type to parse_string. (#10438)Patrick Cloke2021-07-211-1/+1
| | | | And set the required attribute in a few places which will error if a parameter is not provided.
* Replace `room_depth.min_depth` with a BIGINT (#10289)Richard van der Hoff2021-07-121-7/+97
| | | | | while I'm dealing with INTEGERs and BIGINTs, let's replace room_depth.min_depth with a BIGINT.
* Integrate knock rooms with the public rooms directory (#9359)Andrew Morgan2021-06-091-5/+9
| | | | | | | | | | 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
* Add new admin APIs to remove media by media ID from quarantine. (#10044)Dirk Klimpel2021-06-021-10/+20
| | | | | Related to: #6681, #5956, #10040 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Make reason and score optional for report_event (#10077)Callum Brown2021-05-271-1/+1
| | | | | | Implements MSC2414: https://github.com/matrix-org/matrix-doc/pull/2414 See #8551 Signed-off-by: Callum Brown <callum@calcuode.com>
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | 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>`
* Add an admin API to manage ratelimit for a specific user (#9648)Dirk Klimpel2021-04-131-5/+59
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-8/+15
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Fix some typos.Patrick Cloke2021-02-121-1/+1
|
* Support icons for Identity Providers (#9154)Richard van der Hoff2021-01-201-4/+2
|
* Use a chain cover index to efficiently calculate auth chain difference (#8868)Erik Johnston2021-01-111-2/+49
|
* Make search statement in List Room and User Admin API case-insensitive (#8931)Dirk Klimpel2020-12-171-2/+2
|
* Generalise _maybe_store_room_on_invite (#8754)Andrew Morgan2020-11-131-4/+6
| | | | | | | | | There's a handy function called maybe_store_room_on_invite which allows us to create an entry in the rooms table for a room and its version for which we aren't joined to yet, but we can reference when ingesting events about. This is currently used for invites where we receive some stripped state about the room and pass it down via /sync to the client, without us being in the room yet. There is a similar requirement for knocking, where we will eventually do the same thing, and need an entry in the rooms table as well. Thus, reusing this function works, however its name needs to be generalised a bit. Separated out from #6739.
* Split admin API for reported events into a detail and a list view (#8539)Dirk Klimpel2020-10-261-17/+87
| | | | | | | | | | | | Split admin API for reported events in detail und list view. API was introduced with #8217 in synapse v.1.21.0. It makes the list (`GET /_synapse/admin/v1/event_reports`) less complex and provides a better overview. The details can be queried with: `GET /_synapse/admin/v1/event_reports/<report_id>`. It is similar to room and users API. It is a kind of regression in `GET /_synapse/admin/v1/event_reports`. `event_json` was removed. But the api was introduced one version before and it is an admin API (not under spec). Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Move additional tasks to the background worker, part 4 (#8513)Patrick Cloke2020-10-131-85/+83
|
* Allow background tasks to be run on a separate worker. (#8369)Patrick Cloke2020-10-021-12/+12
|
* Use `async with` for ID gens (#8383)Erik Johnston2020-09-231-3/+3
| | | This will allow us to hit the DB after we've finished using the generated stream ID.
* Admin API for reported events (#8217)Dirk Klimpel2020-09-221-0/+95
| | | Add an admin API to read entries of table `event_reports`. API: `GET /_synapse/admin/v1/event_reports`
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-3/+3
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Add the topic and avatar to the room details admin API (#8305)Tulir Asokan2020-09-141-1/+2
|
* Convert additional databases to async/await part 2 (#8200)Patrick Cloke2020-09-011-21/+28
|
* Convert calls of async database methods to async (#8166)Patrick Cloke2020-08-271-5/+11
|
* Convert simple_update* and simple_select* to async (#8173)Patrick Cloke2020-08-271-2/+2
|
* Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke2020-08-261-5/+5
|
* Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston2020-08-251-3/+3
| | | | This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
* Use the JSON encoder without whitespace in more places. (#8124)Patrick Cloke2020-08-201-3/+2
|
* Remove some unused database functions. (#8085)Patrick Cloke2020-08-141-4/+0
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+1429