Brendan Abolivier
74050d0c1c
Merge branch 'develop' into matrix-org-hotfixes
2020-03-09 15:06:56 +00:00
Patrick Cloke
7dcbc33a1b
Validate the alt_aliases property of canonical alias events ( #6971 )
2020-03-03 07:12:45 -05:00
Richard van der Hoff
69111a8b2a
Merge branch 'develop' into matrix-org-hotfixes
2020-02-27 10:46:36 +00:00
Erik Johnston
1f773eec91
Port PresenceHandler to async/await ( #6991 )
2020-02-26 15:33:26 +00:00
Richard van der Hoff
9dbe34f0d0
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
2020-02-19 11:40:25 +00:00
Richard van der Hoff
a0a1fd0bec
Add `allow_departed_users` param to `check_in_room_or_world_readable`
...
... and set it everywhere it's called.
while we're here, rename it for consistency with `check_user_in_room` (and to
help check that I haven't missed any instances)
2020-02-19 08:52:51 +00:00
Erik Johnston
bc936b5657
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2020-02-18 16:11:26 +00:00
Richard van der Hoff
5d17c31596
make FederationHandler.send_invite async
2020-02-03 22:28:11 +00:00
Erik Johnston
c854d255e5
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2020-01-31 15:06:16 +00:00
Richard van der Hoff
d7bf793cc1
s/get_room_version/get_room_version_id/
...
... to make way for a forthcoming get_room_version which returns a RoomVersion
object.
2020-01-31 10:06:21 +00:00
Richard van der Hoff
a8ce7aeb43
Pass room version object into event_auth.check and check_redaction ( #6788 )
...
These are easier to work with than the strings and we normally have one around.
This fixes `FederationHander._persist_auth_tree` which was passing a
RoomVersion object into event_auth.check instead of a string.
2020-01-28 14:18:29 +00:00
Erik Johnston
45bf455948
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2020-01-07 14:24:36 +00:00
Richard van der Hoff
859663565c
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
2020-01-06 15:43:41 +00:00
Richard van der Hoff
3bef62488e
Remove unused hashes and depths from create_event params
2020-01-06 13:45:33 +00:00
Richard van der Hoff
66ca914dc0
Remove unused hashes and depths from create_new_client_event params
2020-01-06 13:45:33 +00:00
Richard van der Hoff
15720092ac
replace get_prev_events_and_hashes_for_room with get_prev_events_for_room in create_new_client_event
2020-01-06 13:45:33 +00:00
Richard van der Hoff
5a04781643
rename get_prev_events_for_room to get_prev_events_and_hashes_for_room
...
... to make way for a new method which just returns the event ids
2020-01-06 13:45:33 +00:00
Erik Johnston
fa780e9721
Change EventContext to use the Storage class ( #6564 )
2019-12-20 10:32:02 +00:00
Andrew Morgan
fc316a4894
Prevent redacted events from appearing in message search ( #6377 )
2019-12-11 13:39:47 +00:00
Neil Johnson
0a522121a0
Merge branch 'release-v1.7.0' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-12-10 11:25:28 +00:00
Erik Johnston
8ad8bcbed0
Pull out room_invite_state_types config option once.
...
Pulling things out of config is currently surprisingly expensive.
2019-12-09 11:52:19 +00:00
Brendan Abolivier
54dd5dc12b
Add ephemeral messages support (MSC2228) ( #6409 )
...
Implement part [MSC2228](https://github.com/matrix-org/matrix-doc/pull/2228 ). The parts that differ are:
* the feature is hidden behind a configuration flag (`enable_ephemeral_messages`)
* self-destruction doesn't happen for state events
* only implement support for the `m.self_destruct_after` field (not the `m.self_destruct` one)
* doesn't send synthetic redactions to clients because for this specific case we consider the clients to be able to destroy an event themselves, instead we just censor it (by pruning its JSON) in the database
2019-12-03 19:19:45 +00:00
Brendan Abolivier
708cef88cf
Discard retention policies when retrieving state
...
Purge jobs don't delete the latest event in a room in order to keep the forward extremity and not break the room. On the other hand, get_state_events, when given an at_token argument calls filter_events_for_client to know if the user can see the event that matches that (sync) token. That function uses the retention policies of the events it's given to filter out those that are too old from a client's view.
Some clients, such as Riot, when loading a room, request the list of members for the latest sync token it knows about, and get confused to the point of refusing to send any message if the server tells it that it can't get that information. This can happen very easily with the message retention feature turned on and a room with low activity so that the last event sent becomes too old according to the room's retention policy.
An easy and clean fix for that issue is to discard the room's retention policies when retrieving state.
2019-11-28 19:26:26 +00:00
Erik Johnston
6d1a3e2bdd
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-11-19 12:59:39 +00:00
Brendan Abolivier
09957ce0e4
Implement per-room message retention policies
2019-11-04 17:09:22 +00:00
Amber Brown
020add5099
Update black to 19.10b0 ( #6304 )
...
* update version of black and also fix the mypy config being overridden
2019-11-01 02:43:24 +11:00
Erik Johnston
dfe0cd71b6
Merge pull request #6294 from matrix-org/erikj/add_state_storage
...
Add StateGroupStorage interface
2019-10-31 16:17:53 +01:00
Andrew Morgan
54fef094b3
Remove usage of deprecated logger.warn method from codebase ( #6271 )
...
Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
2019-10-31 10:23:24 +00:00
Erik Johnston
69f0054ce6
Port to use state storage
2019-10-30 14:46:54 +00:00
Erik Johnston
3ca4c7c516
Use new EventPersistenceStore
2019-10-23 16:15:03 +01:00
Richard van der Hoff
6e6b53ed3a
Merge branch 'develop' into matrix-org-hotfixes
2019-09-26 15:22:33 +01:00
Neil Johnson
034db2ba21
Fix dummy event insertion consent bug ( #6053 )
...
Fixes #5905
2019-09-26 11:47:53 +01:00
Richard van der Hoff
7b61e6f5d6
Merge branch 'develop' into matrix-org-hotfixes
2019-09-18 13:55:25 +01:00
Erik Johnston
57dd41a45b
Fix comments
...
Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2019-09-11 13:54:50 +01:00
Erik Johnston
c64c3bb4c5
Fix how we check for self redaction
2019-09-11 11:18:04 +01:00
Erik Johnston
54ce81c86d
Allow use of different ratelimits for admin redactions.
...
This is useful to allow room admins to quickly deal with a large number
of abusive messages.
2019-09-11 10:46:38 +01:00
Erik Johnston
a81e0233e9
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-08-29 11:18:57 +01:00
Will Hunt
c998f25006
Apply suggestions from code review
...
Co-Authored-By: Erik Johnston <erik@matrix.org>
2019-08-23 10:28:54 +01:00
Half-Shot
9ba32f6573
Exempt bot users
2019-08-23 09:56:31 +01:00
Half-Shot
886eceba3e
Return user_type in get_user_by_id
2019-08-23 09:14:52 +01:00
Erik Johnston
873ff9522b
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-08-01 14:46:09 +01:00
Erik Johnston
cf89266b98
Deny redaction of events in a different room.
...
We already correctly filter out such redactions, but we should also deny
them over the CS API.
2019-07-31 16:12:27 +01:00
Erik Johnston
65fe31786d
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-07-30 10:12:13 +01:00
Richard van der Hoff
f30a71a67b
Stop trying to fetch events with event_id=None. ( #5753 )
...
`None` is not a valid event id, so queuing up a database fetch for it seems
like a silly thing to do.
I considered making `get_event` return `None` if `event_id is None`, but then
its interaction with `allow_none` seemed uninituitive, and strong typing ftw.
2019-07-24 13:16:18 +01:00
Amber Brown
4806651744
Replace returnValue with return ( #5736 )
2019-07-23 23:00:55 +10:00
Richard van der Hoff
4102cb220a
Merge branch 'release-v1.2.0' into matrix-org-hotfixes
2019-07-18 15:20:00 +01:00
Richard van der Hoff
9c70a02a9c
Ignore redactions of m.room.create events ( #5701 )
2019-07-17 19:08:02 +01:00
Erik Johnston
5299707329
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-07-17 10:56:55 +01:00
Amber Brown
463b072b12
Move logging utilities out of the side drawer of util/ and into logging/ ( #5606 )
2019-07-04 00:07:04 +10:00
Erik Johnston
67b73fd147
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-06-21 13:27:04 +01:00
Amber Brown
32e7c9e7f2
Run Black. ( #5482 )
2019-06-20 19:32:02 +10:00
Erik Johnston
554609288b
Run as background process and fix comments
2019-06-19 11:33:03 +01:00
Erik Johnston
b42f90470f
Add experimental option to reduce extremities.
...
Adds new config option `cleanup_extremities_with_dummy_events` which
periodically sends dummy events to rooms with more than 10 extremities.
THIS IS REALLY EXPERIMENTAL.
2019-06-18 15:02:18 +01:00
Erik Johnston
c08e4dbadc
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-06-17 14:10:28 +01:00
Brendan Abolivier
f874b16b2e
Add plugin APIs for implementations of custom event rules.
2019-06-14 18:16:03 +01:00
Erik Johnston
bbcd19f2d0
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-05-24 10:53:01 +01:00
Erik Johnston
d16f5574b6
Merge pull request #5220 from matrix-org/erikj/dont_bundle_live_events
...
Don't bundle aggregations with events in /sync or /events or state queries
2019-05-24 10:36:31 +01:00
Erik Johnston
4cb577c23f
Don't bundle aggs for /state and /members etc APIs
2019-05-24 09:52:33 +01:00
Erik Johnston
3cd598135f
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-05-23 15:54:13 +01:00
Erik Johnston
44b8ba484e
Fix words
2019-05-21 16:51:45 +01:00
Erik Johnston
c7ec06e8a6
Block attempts to annotate the same event twice
2019-05-20 17:39:05 +01:00
Richard van der Hoff
ca03f90ee7
Merge branch 'develop' into matrix-org-hotfixes
2019-05-20 15:55:39 +01:00
Erik Johnston
b54b03f9e1
Allow client event serialization to be async
2019-05-14 11:58:01 +01:00
Richard van der Hoff
9feee29d76
v0.99.4rc1
...
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEdVkXOgzrGzds0jtrHgFcFF8ZFs0FAlzZihYACgkQHgFcFF8Z
Fs325w/8DOsFbrvITIYNpHKB8fZ4udrzwL/R+PRV+G5e/piJBumvnCtGqWFIKzwO
FiF7M+7xPfATxI8sKHcFE7HAbG7/5zCFTp4vgVul6vzt2lhGR6uY0ZmBn7LizIiR
++eXAqfsqO4p6PepS5X3Mv17EiIQl+PFfN81va7/t4pk3YXtaucVAzYmlNWmHPiD
KwyH9OsXdgu00/9QIBh+h2gCeB19e++6b+Ry2ZcMJAOgv8bgRisnjy35d0bN8uGR
XSGFz9VEH4B8yvCOI9l9L4S+BvRmM+uL8qD5BSq5NIRqKt+YgdE9ioVscy461Xag
lFjDqjkZxLRDHtLP2gGCM6iLaMIt1wZ3czC2P8YObgtVeskHaqK6rxKs1tP/jz+M
fd7vXQpqA9zSmNJZ2p/nDFpcP1FRw6/gnYxqemcFOhSCmUeZcznaAkMBOCqW7XFF
w9EOC5WIWmjHROsOdU59XgWai4igc2kTpflvM8jGWDYTdH4XOnGrde2MKCY+hYc4
J/dII0sOKlMJzS9cqXkoWhARt+E+OeCbgDjnPnYvLX3AHZJcySGdQMzl+o2TKkYG
MBGm6DDYsuKMx0Uv18b8WM1dWPbAyOXzxgBYFNuNOZLCZI81LE1jZf86rUnLvDqQ
JTWBIQJhFiX6YxHMr5Enbtc1qoWp0rhlmCxnXpATSJQMc8pXVPY=
=9pbU
-----END PGP SIGNATURE-----
Merge tag 'v0.99.4rc1' into matrix-org-hotfixes
v0.99.4rc1
2019-05-14 11:12:22 +01:00
Brendan Abolivier
1473058b5e
Do checks on aliases for incoming m.room.aliases events ( #5128 )
...
Follow-up to #5124
Also added a bunch of checks to make sure everything (both the stuff added on #5124 and this PR) works as intended.
2019-05-08 17:01:30 +01:00
Erik Johnston
8467756dc1
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-04-04 14:43:57 +01:00
Andrew Morgan
4a4d5c4fd6
Fix grammar and document get_current_users_in_room ( #4998 )
2019-04-03 14:32:20 +01:00
Richard van der Hoff
f41c9d37d6
Merge branch 'develop' into matrix-org-hotfixes
2019-04-02 13:47:08 +01:00
Richard van der Hoff
54a87a7b08
Collect room-version variations into one place ( #4969 )
...
Collect all the things that make room-versions different to one another into
one place, so that it's easier to define new room versions.
2019-04-01 10:24:38 +01:00
Erik Johnston
b0bf1ea7bd
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-03-21 14:10:31 +00:00
Erik Johnston
cd62981a6a
Revert spurious delete
2019-03-20 17:51:27 +00:00
Erik Johnston
aa959a6c07
Use flags
2019-03-20 17:40:29 +00:00
Erik Johnston
7d47cc1305
Move requester check into assert_accepted_privacy_policy
2019-03-20 17:08:36 +00:00
Erik Johnston
74c46d81fa
Only require consent for events with an associated request
...
There are a number of instances where a server or admin may puppet a
user to join/leave rooms, which we don't want to fail if the user has
not consented to the privacy policy. We fix this by adding a check to
test if the requester has an associated access_token, which is used as a
proxy to answer the question of whether the action is being done on
behalf of a real request from the user.
2019-03-20 16:50:23 +00:00
Richard van der Hoff
2561b628af
Merge branch 'develop' into matrix-org-hotfixes
2019-03-19 12:19:20 +00:00
Neil Johnson
88f0675967
fix test_auto_create_auto_join_where_no_consent ( #4886 )
2019-03-19 11:38:59 +00:00
Erik Johnston
dc510e0e43
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-03-05 14:41:13 +00:00
Richard van der Hoff
3064952939
Fix incorrect log about not persisting duplicate state event. ( #4776 )
...
We were logging this when it was not true.
2019-03-01 16:47:12 +00:00
Erik Johnston
d351be1567
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-01-30 11:48:29 +00:00
Erik Johnston
a696c48133
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/redactions_eiah
2019-01-29 22:00:33 +00:00
Erik Johnston
5891a6edc8
Correctly set context.app_service
2019-01-29 12:09:10 +00:00
Erik Johnston
7709d2bd16
Implement rechecking of redactions
2019-01-29 11:56:20 +00:00
Erik Johnston
be47cfa9c9
Refactor event building into EventBuilder
...
This is so that everything is done in one place, making it easier to
change the event format based on room version
2019-01-29 11:13:00 +00:00
Erik Johnston
073f6c2e5e
Merge pull request #4494 from matrix-org/erikj/fixup_event_validator
...
Split up event validation between event and builder
2019-01-29 10:55:07 +00:00
Andrew Morgan
c7f2eaf4f4
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2019-01-29 10:07:13 +00:00
Erik Johnston
d758d5310e
Correctly use default room version if none is set
2019-01-28 17:26:39 +00:00
Erik Johnston
b872c7b1b4
Split up event validation between event and builder
...
The validator was being run on the EventBuilder objects, and so the
validator only checked a subset of fields. With the upcoming
EventBuilder refactor even fewer fields will be there to validate.
To get around this we split the validation into those that can be run
against an EventBuilder and those run against a fully fledged event.
2019-01-28 17:00:14 +00:00
Erik Johnston
ae2a957dba
Pass through room version to event auth
2019-01-25 18:31:41 +00:00
Erik Johnston
a50cf929c1
Require event format version to parse or create events
2019-01-25 10:32:19 +00:00
Erik Johnston
be6a7e47fa
Revert "Require event format version to parse or create events"
2019-01-25 10:23:51 +00:00
Erik Johnston
f431ff3fb8
Require event format version to parse or create events
2019-01-23 20:21:33 +00:00
Richard van der Hoff
34406cf22c
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
2018-11-06 10:49:20 +00:00
Richard van der Hoff
9b827c40ca
Log some bits about event creation ( #4121 )
...
I found these helpful in debugging my room upgrade tests.
2018-10-31 15:42:23 +00:00
Erik Johnston
9f2d14ee26
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2018-10-26 09:52:23 +01:00
Erik Johnston
cb53ce9d64
Refactor state group lookup to reduce DB hits ( #4011 )
...
Currently when fetching state groups from the data store we make two
hits two the database: once for members and once for non-members (unless
request is filtered to one or the other). This adds needless load to the
datbase, so this PR refactors the lookup to make only a single database
hit.
2018-10-25 17:49:55 +01:00
Richard van der Hoff
e7a16c6210
Remove redundant run_as_background_process() from pusherpool
...
`on_new_notifications` and `on_new_receipts` in `HttpPusher` and `EmailPusher`
now always return synchronously, so we can remove the `defer.gatherResults` on
their results, and the `run_as_background_process` wrappers can be removed too
because the PusherPool methods will now complete quickly enough.
2018-10-22 16:12:11 +01:00
Erik Johnston
7fa156af80
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2018-10-02 14:39:30 +01:00
Richard van der Hoff
8174c6725b
Avoid reraise, to improve stacktraces
2018-10-01 18:50:34 +01:00
Erik Johnston
f5abc10724
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
2018-08-20 11:12:18 +01:00
Richard van der Hoff
c144252a8c
Merge pull request #3710 from matrix-org/rav/logcontext_for_pusher_updates
...
Fix logcontexts for running pushers
2018-08-17 16:21:49 +01:00