summary refs log tree commit diff
path: root/synapse/events (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add support for persisting event format versionsErik Johnston2019-01-231-0/+5
| | | | | | | | | | | | | | Currently we only have the one event format version defined, but this adds the necessary infrastructure to persist and fetch the format versions alongside the events. We specify the format version rather than the room version as: 1. We don't necessarily know the room version, existing events may be either v1 or v2. 2. We'd need to be careful to prevent/handle correctly if different events in the same room reported to be of different versions, which sounds annoying.
* Add helpers for getting prev and auth events (#4139)Erik Johnston2018-11-061-0/+18
| | | | | | | * Add helpers for getting prev and auth events This is in preparation for allowing the event format to change between room versions.
* Disable frozen dicts by default (#3987)Amber Brown2018-10-021-3/+10
|
* Fix handling of redacted events from federationErik Johnston2018-09-131-0/+5
| | | | | | | | | | If we receive an event that doesn't pass their content hash check (e.g. due to already being redacted) then we hit a bug which causes an exception to be raised, which then promplty stops the event (and request) from being processed. This effects all sorts of federation APIs, including joining rooms with a redacted state event.
* Handle delta_ids being None in _update_context_for_auth_eventsRichard van der Hoff2018-07-231-1/+2
| | | | | | | it's easier to create the new state group as a delta from the existing one. (There's an outside chance this will help with https://github.com/matrix-org/synapse/issues/3364)
* CommentsErik Johnston2018-07-231-2/+3
|
* Only get cached state from context in persist_eventErik Johnston2018-07-231-0/+13
| | | | | | We don't want to bother pulling out the current state from the DB since until we know we have to. Checking the context for state is just an optimisation.
* Fix missing attributes on workers.Erik Johnston2018-07-231-4/+6
| | | | | This was missed during the transition from attribute to getter for getting state from context.
* Fix EventContext when using workersErik Johnston2018-07-231-7/+7
| | | | | | We were: 1. Not correctly setting all attributes 2. Using defer.inlineCallbacks in a non-generator
* Update docstrings to make senseErik Johnston2018-07-231-5/+8
|
* Add support for updating stateErik Johnston2018-07-231-0/+19
|
* Make EventContext lazy load stateErik Johnston2018-07-231-41/+112
|
* pep8Erik Johnston2018-07-231-1/+1
|
* Refcator EventContext to accept state during initErik Johnston2018-07-231-21/+27
|
* Make the rest of the .iterwhatever go away (#3562)Amber Brown2018-07-211-1/+3
|
* run isortAmber Brown2018-07-095-15/+14
|
* Consistently use six's iteritems and wrap lazy keys/values in list() if ↵Amber Brown2018-05-311-1/+1
| | | | they're not meant to be lazy (#3307)
* Replace some more comparisons with sixAdrian Tschira2018-05-192-3/+7
| | | | | | plus a bonus b"" string I missed last time Signed-off-by: Adrian Tschira <nota@notafile.com>
* add comment explaining attributeerrorAdrian Tschira2018-04-301-0/+3
|
* Make event properties raise AttributeError insteadAdrian Tschira2018-04-151-3/+12
| | | | | | | | | | | | | They raised KeyError before. I'm changing this because the code uses hasattr() to check for the presence of a key. This worked accidentally before, because hasattr() silences all exceptions in python 2. However, in python3, this isn't the case anymore. I had a look around to see if anything depended on this raising a KeyError and I couldn't find anything. Of course, I could have simply missed it. Signed-off-by: Adrian Tschira <nota@notafile.com>
* Remove context.push_actionsErik Johnston2018-02-151-4/+0
|
* Don't serialize current state over replicationErik Johnston2018-02-151-6/+35
|
* Add replication http endpoint for event sendingErik Johnston2018-02-071-0/+72
|
* Store state groups separately from events (#2784)Erik Johnston2018-02-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split state group persist into seperate storage func * Add per database engine code for state group id gen * Move store_state_group to StateReadStore This allows other workers to use it, and so resolve state. * Hook up store_state_group * Fix tests * Rename _store_mult_state_groups_txn * Rename StateGroupReadStore * Remove redundant _have_persisted_state_group_txn * Update comments * Comment compute_event_context * Set start val for state_group_id_seq ... otherwise we try to recreate old state groups * Update comments * Don't store state for outliers * Update comment * Update docstring as state groups are ints
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-1/+1
| | | | what could possibly go wrong
* Remove pointless create() methodRichard van der Hoff2017-10-201-1/+1
| | | | | It just calls the constructor, so we may as well kill it rather than having random codepaths.
* Spam checking: add the invitee to user_may_inviteDavid Baker2017-10-051-2/+2
|
* spam check room publishingDavid Baker2017-10-041-0/+18
|
* Add room creation checks to spam checkerDavid Baker2017-10-041-0/+32
| | | | | Lets the spam checker deny attempts to create rooms and add aliases to them.
* s/roomid/room_id/David Baker2017-10-031-2/+2
|
* pass room id tooDavid Baker2017-10-031-2/+2
|
* Actually write warpper functionDavid Baker2017-10-031-0/+16
|
* Don't test is spam_checker not NoneDavid Baker2017-09-271-1/+7
| | | | | Sometimes it's a Mock object which is not none but is still not what we're after
* Remove unintentional debuggingDavid Baker2017-09-271-1/+0
|
* pep8David Baker2017-09-271-0/+1
|
* Make the spam checker a moduleDavid Baker2017-09-261-17/+20
|
* fix thinko'd docstringMatthew Hodgson2017-09-221-1/+1
|
* PoC for filtering spammy events (#2456)Richard van der Hoff2017-09-191-0/+38
| | | Demonstration of how you might add some hooks to filter out spammy events.
* Add more granular event send metricsErik Johnston2017-05-021-0/+3
|
* Comment and remove spurious loggingErik Johnston2017-04-271-0/+3
|
* Fix testsErik Johnston2017-04-261-3/+3
|
* Fix invite state to always include all eventsErik Johnston2017-04-261-1/+19
|
* Refactoring and cleanupsRichard van der Hoff2017-03-171-0/+26
| | | | | | | | | | | | A few non-functional changes: * A bunch of docstrings to document types * Split `EventsStore._persist_events_txn` up a bit. Hopefully it's a bit more readable. * Rephrase `EventFederationStore._update_min_depth_for_room_txn` to avoid mind-bending conditional. * Rephrase rejected/outlier conditional in `_update_outliers_txn` to avoid mind-bending conditional.
* Optimise state resolutionErik Johnston2017-01-172-4/+10
|
* gah, fix mangled merge of 0.18.7 into developMatthew Hodgson2017-01-071-1/+1
|
* Only send events that originate on this server.Mark Haines2017-01-051-0/+9
| | | | | | Or events that are sent via the federation "send_join" API. This should match the behaviour from before v0.18.5 and #1635 landed.
* Review commentsKegan Dougal2016-11-221-11/+9
|
* Also check for dict since sometimes they aren't frozenKegan Dougal2016-11-221-1/+1
|
* Glue only_event_fields into the sync rest servletKegan Dougal2016-11-221-1/+1
|
* More testsKegan Dougal2016-11-221-3/+4
|
* Start adding some testsKegan Dougal2016-11-211-1/+3
|
* Move event_fields filtering to serialize_eventKegan Dougal2016-11-211-4/+97
| | | | Also make it an inclusive not exclusive filter, as the spec demands.
* Add commentsErik Johnston2016-09-051-0/+5
|
* Move to storing state_groups_state as deltasErik Johnston2016-09-011-0/+16
|
* Correctly handle the difference between prev and current stateErik Johnston2016-08-311-2/+3
|
* Make None optionalErik Johnston2016-08-261-1/+1
|
* Replace context.current_state with context.current_state_idsErik Johnston2016-08-251-11/+2
|
* Pull out event ids rather than full events for stateErik Johnston2016-08-251-0/+8
|
* Include prev_content in redacted state eventsErik Johnston2016-08-111-0/+2
|
* Remove the is_new_state argument to persist event.Mark Haines2016-03-311-0/+3
| | | | | | | | | Move the checks for whether an event is new state inside persist event itself. This was harder than expected because there wasn't enough information passed to persist event to correctly handle invites from remote servers for new rooms.
* Use a stream id generator to assign state group idsMark Haines2016-03-301-1/+1
|
* Intern all the thingsErik Johnston2016-03-231-9/+2
|
* Intern sender, event_id and room_id in eventsErik Johnston2016-03-231-0/+5
|
* Intern type and state_key on eventsErik Johnston2016-03-231-0/+7
|
* Don't assume existence of event_id in __str__Erik Johnston2016-03-181-1/+3
|
* Atomically persit push actions when we persist the eventErik Johnston2016-02-091-0/+1
|
* Make Event objects behave more like dictsErik Johnston2016-01-181-0/+9
|
* copyrightsMatthew Hodgson2016-01-075-5/+5
|
* Only add the user_id if the sender is presentMark Haines2015-12-011-1/+3
|
* Copy rather than move the fields to shuffle between a v1 and a v2 event.Mark Haines2015-11-301-9/+5
| | | | | | | | | | This should make all v1 APIs compatible with v2 clients. While still allowing v1 clients to access the fields. This makes the documentation easier since we can just document the v2 format and explain that some of the fields, in some of the APIs are duplicated for backwards compatibility, rather than having to document two separate event formats.
* Flatten the /sync response to remove the event_mapRichard van der Hoff2015-11-191-2/+1
|
* Update the other place check_joined_room is calledMark Haines2015-10-301-1/+2
|
* Surely we don't need to preserve 'events_default' twicePaul "LeoNerd" Evans2015-10-161-1/+0
|
* Bundle in some room state in the unsigned bit of the invite when sending to ↵Erik Johnston2015-09-101-1/+4
| | | | invited servers
* Fix bug where we didn't correctly serialize the redacted_because key over ↵Erik Johnston2015-08-211-1/+4
| | | | federation
* Rename key and values for m.room.history_visibility. Support 'invited' valueErik Johnston2015-07-061-1/+1
|
* Add m.room.history_visibility to list of auth eventsErik Johnston2015-07-031-0/+2
|
* Don't copy twiceErik Johnston2015-05-291-1/+1
|
* Add config option to turn off freezing events. Use new encode_json api and ↵Erik Johnston2015-05-291-1/+10
| | | | ujson.loads
* Store the rejected reason in (Frozen)Event structsPaul "LeoNerd" Evans2015-03-251-2/+4
|
* Remove concept of context.auth_events, instead use context.current_stateErik Johnston2015-03-161-2/+1
|
* pyflakesErik Johnston2015-02-111-1/+1
|
* Don't unfreeze when using FreezeEvent.get_dict, as we are using a ↵Erik Johnston2015-02-111-4/+0
| | | | JSONEncoder that understands FrozenDict
* Rearrange persist_event so that do all the queries that need to be done ↵Erik Johnston2015-02-041-1/+1
| | | | before returning early if we have already persisted that event.
* Actually, the old prune_event function was non-deterministic, so no point ↵Erik Johnston2015-02-031-79/+0
| | | | keeping it around :(
* Keep around the old (buggy) version of the prune_event function so that we ↵Erik Johnston2015-02-031-0/+79
| | | | can use it to check signatures for events on old servers
* Merge pull request #43 from matrix-org/rejectionsErik Johnston2015-01-303-6/+12
|\ | | | | Rejections
| * Merge branch 'develop' of github.com:matrix-org/synapse into rejectionsErik Johnston2015-01-301-6/+6
| |\ | | | | | | | | | | | | | | | Conflicts: synapse/storage/__init__.py synapse/storage/schema/delta/v12.sql
| * | Fix bug where we changes in outlier in metadata dict propogated to other eventsErik Johnston2015-01-303-4/+8
| | |
| * | Initial implementation of auth conflict resolutionErik Johnston2015-01-291-2/+4
| | |
* | | Merge pull request #41 from matrix-org/client_v2_syncMark Haines2015-01-301-33/+52
|\ \ \ | | | | | | | | Client v2 sync
| * | | Include transaction ids in unsigned section of events in the sync results ↵Mark Haines2015-01-291-5/+6
| | | | | | | | | | | | | | | | for the clients that made those requests
| * | | Add support for formatting events in the way a v2 client expectsMark Haines2015-01-291-39/+52
| | | |
| * | | Start implementing incremental initial syncMark Haines2015-01-271-0/+1
| | | |
| * | | Start implementing the non-incremental sync portion of the v2 /sync APIMark Haines2015-01-261-1/+5
| | |/ | |/|
* | | Merge branch 'develop' of github.com:matrix-org/synapse into rejections_storageErik Johnston2015-01-301-6/+6
|\| | | |/ |/| | | | | | | Conflicts: synapse/storage/__init__.py synapse/storage/schema/delta/v12.sql
| * Pass the current time to serialize event, rather than passing anMark Haines2015-01-261-6/+6
| | | | | | | | | | | | HS and getting a clock from it and calling time_msec on the clock. Remove the serialize_event method from the HS since it is no longer needed.
* | Add support for storing rejected events in EventContext and data storesErik Johnston2015-01-221-0/+1
|/
* Remove unused functionsMark Haines2015-01-131-6/+0
|
* Merge branch 'hotfixes-v0.6.1b' of github.com:matrix-org/synapse into developErik Johnston2015-01-131-1/+1
|\
| * Insert 'age' into top level when returning events to clientsErik Johnston2015-01-131-1/+1
| |
* | Return the raw federation event rather than adding extra keys for federation ↵Kegan Dougal2015-01-081-9/+16
| | | | | | | | data.
* | Add 'raw' query parameter to expose the event graph and signatures to savvy ↵Kegan Dougal2015-01-081-8/+9
|/ | | | clients.
* Remove unused importErik Johnston2015-01-071-2/+0
|
* Optimize FrozenEvent creationErik Johnston2015-01-061-7/+13
|
* Update copyright noticesMark Haines2015-01-065-5/+5
|
* Remove unneeded federation keys from eventsMark Haines2014-12-191-0/+3
|
* clean up coding style a bitMark Haines2014-12-161-11/+11
|
* Persist internal_metadataErik Johnston2014-12-161-2/+3
|
* Fix pyflakesErik Johnston2014-12-151-2/+0
|
* Use frozenutilsErik Johnston2014-12-151-32/+4
|
* Remove unused functionsErik Johnston2014-12-151-42/+0
|
* Finish up upgrade scriptErik Johnston2014-12-151-1/+1
|
* Fix bug where we ignored event_edge_hashes tableErik Johnston2014-12-151-0/+1
|
* Validate message, topic and name event contentsErik Johnston2014-12-121-0/+21
|
* Fix prev_contentErik Johnston2014-12-111-0/+8
|
* Fix redactions. Fix 'age' keyErik Johnston2014-12-113-3/+32
|
* Add some basic event validationErik Johnston2014-12-101-8/+21
|
* Actually fix bug when uploading state with empty state_keyErik Johnston2014-12-101-0/+1
|
* Fix bug when uploading state with empty state_keyErik Johnston2014-12-101-2/+8
|
* Fix AttributeErrorErik Johnston2014-12-101-0/+3
|
* Add __str__ to FrozenEventErik Johnston2014-12-101-0/+5
|
* Try and figure out how and why signatures are being changed.Erik Johnston2014-12-102-11/+14
|
* Add PEP8 newlinesErik Johnston2014-12-093-3/+3
|
* More bug fixesErik Johnston2014-12-081-8/+1
|
* Various typos and bug fixes.Erik Johnston2014-12-082-1/+4
|
* Start making more things use EventContext rather than event.*Erik Johnston2014-12-052-2/+49
|
* Convert rest and handlers to use new event structureErik Johnston2014-12-042-5/+8
|
* Begin converting things to use the new Event structureErik Johnston2014-12-041-0/+3
|
* WIP for new way of managing events.Erik Johnston2014-12-035-78/+286
|
* Begin fleshing out a new Event objectErik Johnston2014-12-022-0/+194