Commit Graph

668 Commits

Author SHA1 Message Date
Kegan Dougal
f7cac2f7b6 Fix bugs so lazy room joining works as intended. 2015-02-09 15:01:28 +00:00
Kegan Dougal
ac3183caaa Register a user account for the AS when the AS registers. Add 'sender' column to AS table. 2015-02-09 12:03:37 +00:00
Matthew Hodgson
37b6b880ef don't give up if we can't create default avatars during tests 2015-02-07 21:24:08 +00:00
Matthew Hodgson
582019f870 ...and here's the actual impl. git fail. 2015-02-07 13:32:14 +00:00
Kegan Dougal
73a680b2a8 Add errcodes for appservice registrations. 2015-02-06 17:10:04 +00:00
Mark Haines
20db147ef3 SYN-258: get_recent_events_for_room only accepts stream tokens, convert the topological token to a stream token before passing it to get_recent_events_for_room 2015-02-06 16:01:04 +00:00
Mark Haines
55a186485c SYN-258: get_recent_events_for_room only accepts stream tokens, convert the topological token to a stream token before passing it to get_recent_events_for_room 2015-02-06 15:58:40 +00:00
Erik Johnston
cc0532a4bf Explicitly list the RejectedReasons that we can prove 2015-02-06 15:16:26 +00:00
Erik Johnston
e890ce223c Don't query auth if the only difference is events that were rejected due to auth. 2015-02-06 14:16:50 +00:00
Erik Johnston
c78b5fb1f1 Make seen_ids a set 2015-02-06 13:52:16 +00:00
Kegan Dougal
0995810273 Pyflakes: unused variable. 2015-02-06 11:45:19 +00:00
Kegan Dougal
c3ae8def75 Grant ASes the ability to delete aliases in their own namespace. 2015-02-06 11:32:07 +00:00
Kegan Dougal
e426df8e10 Grant ASes the ability to create alias in their own namespace.
Add a new errcode type M_EXCLUSIVE when users try to create aliases inside
AS namespaces, and when ASes try to create aliases outside their own
namespace.
2015-02-06 10:57:14 +00:00
Erik Johnston
3737329d9b Handle the fact the list.remove raises if element doesn't exist 2015-02-06 10:53:18 +00:00
Kegan Dougal
0227618d3c Add m.login.application_service registration procedure.
This allows known application services to register any user ID under their
own user namespace(s).
2015-02-05 17:29:27 +00:00
Kegan Dougal
11e6b3d18b Dependency inject ApplicationServiceApi when creating ApplicationServicesHandler. 2015-02-05 17:04:59 +00:00
Kegan Dougal
cab4c73088 Prevent user IDs in AS namespaces being created/deleted by humans. 2015-02-05 16:46:56 +00:00
Kegan Dougal
e9484d6a95 Prevent aliases in AS namespaces being created/deleted by users. Check with ASes when queried for room aliases via federation. 2015-02-05 16:29:56 +00:00
Kegan Dougal
951690e54d Merge branch 'develop' into application-services 2015-02-05 14:28:03 +00:00
Kegan Dougal
c71456117d Fix user query checks. HS>AS pushing now works. 2015-02-05 14:17:08 +00:00
Erik Johnston
8f5b858a1b Merge branch 'develop' of github.com:matrix-org/synapse into federation_client_retries 2015-02-05 13:50:28 +00:00
Erik Johnston
e1515c3e91 Pass through list of room hosts from room alias query to federation so that it can retry against different room hosts 2015-02-05 13:44:42 +00:00
Kegan Dougal
51d63ac329 Glue AS work to general event notifications. Add more exception handling when poking ASes. 2015-02-05 13:19:46 +00:00
Erik Johnston
26a041541b SYN-202: Log as WARN the 404 'Presence information not visible' errors instead of as ERROR since they were spamming the logs 2015-02-05 13:17:05 +00:00
Kegan Dougal
b932600653 Add unknown room alias check. Call it from directory_handler.get_association 2015-02-05 11:47:11 +00:00
Kegan Dougal
f0c730252f Add unknown user ID check. Use store.get_aliases_for_room(room_id) when searching for services by alias. 2015-02-05 11:25:32 +00:00
Kegan Dougal
27091f146a Add hs_token column and generate a different token f.e application service. 2015-02-05 10:08:12 +00:00
Kegan Dougal
a1a4960baf Impl push_bulk function 2015-02-05 09:43:22 +00:00
Kegan Dougal
96d4bf9012 Modify API for SimpleHttpClient.get_json and update usages.
Previously, this would only return the HTTP body as JSON, and discard other
response information (e.g. the HTTP response code). This has now been changed
to throw a CodeMessageException on a non-2xx response, with the response code
and body, which can then be parsed as JSON.

Affected modules include:
 - Registration/Login (when using an email for IS auth)
2015-02-04 17:07:31 +00:00
Kegan Dougal
aa8cce58bf Add query_user/alias APIs. 2015-02-04 16:44:53 +00:00
Erik Johnston
d45e2302ed Merge branch 'signature_failures' of github.com:matrix-org/synapse into federation_client_retries 2015-02-04 16:30:15 +00:00
Erik Johnston
ae46f10fc5 Apply sanity to the transport client interface. Convert 'make_join' and 'send_join' to accept iterables of destinations 2015-02-04 16:28:12 +00:00
Erik Johnston
95e2d2d36d When returning lists of servers from alias lookups, put the current server first in the list 2015-02-04 15:02:23 +00:00
Erik Johnston
650e32d455 Change context.auth_events to what the auth_events would be bases on context.current_state, rather than based on the auth_events from the event. 2015-02-04 14:06:46 +00:00
Kegan Dougal
525a218b2b Begin to add unit tests for appservice glue and regex testing. 2015-02-04 12:24:20 +00:00
Kegan Dougal
17753f0c20 Add stub ApplicationServiceApi and glue it with the handler. 2015-02-04 11:19:18 +00:00
Erik Johnston
c0462dbf15 Rearrange persist_event so that do all the queries that need to be done before returning early if we have already persisted that event. 2015-02-04 10:16:51 +00:00
Erik Johnston
7dd1c5c542 Neaten the handling of state and auth_chain up a bit 2015-02-03 16:12:04 +00:00
Kegan Dougal
94a5db9f4d Add appservice package and move ApplicationService into it. 2015-02-03 14:44:16 +00:00
Erik Johnston
6efd4d1649 Don't completely die if get auth_chain or querying auth_chain requests fail 2015-02-03 13:57:54 +00:00
Erik Johnston
77a076bd25 Set combinations is | and not + 2015-02-03 13:35:17 +00:00
Kegan Dougal
f2c039bfb9 Implement restricted namespace checks. Begin fleshing out the main hook for notifying application services. 2015-02-03 13:29:27 +00:00
Erik Johnston
fed29251d7 Spelling 2015-02-03 13:23:58 +00:00
Kegan Dougal
a060b47b13 Add namespace constants. Add restrict_to option to limit namespace checks. 2015-02-03 13:17:28 +00:00
Kegan Dougal
197f3ea4ba Implement regex checks for app services.
Expose handler.get_services_for_event which manages the checks for all
services.
2015-02-03 11:26:33 +00:00
Erik Johnston
06c34bfbae Give exception better message 2015-02-03 11:23:44 +00:00
Erik Johnston
4ff2273b30 Add FIXME note. 2015-02-03 11:23:26 +00:00
Erik Johnston
51969f9e5f Return rejected events if asked for it over federation. 2015-02-03 10:40:14 +00:00
Erik Johnston
e7ca813dd4 Try to ensure we don't persist an event we have already persisted. In persist_event check if we already have the event, if so then update instead of replacing so that we don't cause a bump of the stream_ordering. 2015-02-03 10:39:41 +00:00
Kegan Dougal
1a2de0c5fe Implement txns for AS (un)registration. 2015-02-02 17:39:41 +00:00
Kegan Dougal
c059c9fea5 Merge branch 'develop' into application-services
Conflicts:
	synapse/handlers/__init__.py
	synapse/storage/__init__.py
2015-02-02 15:57:59 +00:00
Erik Johnston
4c0da49d7c Resign events when we return them via /query_auth/ 2015-01-30 22:53:13 +00:00
Mark Haines
0b1cc7cc0b Return empty list rather than None when there are no emphemeral events for a room 2015-01-30 16:56:13 +00:00
Erik Johnston
2cd29dbdd9 Fix bug where accepting invite over federation didn't work. Add logging. 2015-01-30 16:51:58 +00:00
Erik Johnston
7d897f5bfc Merge pull request #43 from matrix-org/rejections
Rejections
2015-01-30 16:11:14 +00:00
Erik Johnston
b724a809c4 Only auth_events with event if event in event.auth_events 2015-01-30 15:57:53 +00:00
Mark Haines
017dfaef4c Add doc string for __nonzero__ overrides for sync results, raise not implemented if the client attempts to do a gapless sync 2015-01-30 15:52:05 +00:00
Mark Haines
8fe39a0311 Check if the user has joined the room between incremental syncs 2015-01-30 13:38:34 +00:00
Erik Johnston
a70a801184 Fix bug where we superfluously asked for current state. Change API of /query_auth/ so that we don't duplicate events in the response. 2015-01-30 13:34:01 +00:00
Mark Haines
4a67834bc8 Pass client info to the sync_config 2015-01-30 11:50:15 +00:00
Mark Haines
8498d348d8 Fix token formatting 2015-01-30 11:42:09 +00:00
Mark Haines
e97de6d96a Filter the recent events before applying the limit when doing an initial sync 2015-01-30 11:35:20 +00:00
Mark Haines
22dd1cde2d Filter the recent events before applying the limit when doing an incremental sync with a gap 2015-01-30 11:32:35 +00:00
Erik Johnston
2ebf795c0a Merge branch 'develop' of github.com:matrix-org/synapse into rejections
Conflicts:
	synapse/storage/__init__.py
	synapse/storage/schema/delta/v12.sql
2015-01-30 11:10:37 +00:00
Erik Johnston
0c2d245fdf Update the current state of an event if we update auth events. 2015-01-30 11:08:52 +00:00
Erik Johnston
c1d860870b Fix regression where we no longer correctly handled the case of gaps in our event graph 2015-01-30 10:48:47 +00:00
Mark Haines
ece828a7b7 Update todo for the filtering on sync 2015-01-29 18:15:24 +00:00
Erik Johnston
78015948a7 Initial implementation of auth conflict resolution 2015-01-29 16:52:33 +00:00
Mark Haines
4ad45f2582 Fix indent 2015-01-29 16:41:49 +00:00
Mark Haines
722b65f461 Move typing notifs to an "emphermal" event list on the room object 2015-01-29 16:41:21 +00:00
Mark Haines
cc42d3f907 Fix check for empty room update 2015-01-29 16:27:38 +00:00
Mark Haines
4d9dd9bdc0 Fix v2 initial sync 2015-01-29 16:23:03 +00:00
Mark Haines
e016f4043b Use get_room_events_stream to get changes to the rooms if the number of changes is small 2015-01-29 14:40:28 +00:00
Mark Haines
e3e72b8c5c Remove typing TODO 2015-01-29 03:35:25 +00:00
Mark Haines
3dbce6f4a5 Add typing notifications to sync 2015-01-29 03:33:51 +00:00
Mark Haines
9c61556504 Merge branch 'develop' into client_v2_sync 2015-01-28 17:29:30 +00:00
Mark Haines
26c8fff19e Merge pull request #36 from matrix-org/device_id_from_access_token
Extract the device id and token id from the access token when autheniticating users
2015-01-28 17:19:28 +00:00
Mark Haines
388581e087 Extract the id token of the token when authing users, include the token and device_id in the internal meta data for the event along with the transaction id when sending events 2015-01-28 16:58:23 +00:00
Erik Johnston
0ef5bfd6a9 Start implementing auth conflict res 2015-01-28 16:16:53 +00:00
David Baker
6840e7cece Merge branch 'master' into develop 2015-01-28 16:03:35 +00:00
David Baker
c291a4d522 Merge branch 'develop' into pushers
Conflicts:
	synapse/handlers/events.py
	synapse/server.py
2015-01-28 12:51:05 +00:00
Kegan Dougal
42876969b9 Add basic application_services SQL, and hook up parts of the appservice store to read from it. 2015-01-28 11:59:38 +00:00
David Baker
273b12729b Reset badge count to zero when last active time is bumped 2015-01-28 11:55:49 +00:00
David Baker
e32ded7b3e Add matrix.org as a trusted ID server because it's now passed through on ports 80/443 and the web client defaults to that now. Fixes email validation (including signing up with an email address). 2015-01-28 10:09:54 +00:00
Mark Haines
e020574d65 Fix Formatting 2015-01-27 20:19:36 +00:00
Mark Haines
b19cf6a105 Wait for events if the incremental sync is empty and a timeout is given 2015-01-27 20:09:52 +00:00
Kegan Dougal
fbeaeb8689 Log when ASes are registered/unregistered. 2015-01-27 17:34:40 +00:00
Kegan Dougal
ec3719b583 Use ApplicationService when registering. 2015-01-27 17:15:06 +00:00
Kegan Dougal
92171f9dd1 Add stub methods, TODOs and docstrings for application services. 2015-01-27 16:53:59 +00:00
Mark Haines
a56008842b Start implementing incremental initial sync 2015-01-27 16:24:22 +00:00
David Baker
f7c4daa8f9 Oops, remove debugging 2015-01-27 16:08:47 +00:00
David Baker
5eacaeb4a7 or of course we could just return the deferred 2015-01-27 16:05:23 +00:00
David Baker
eba89f093f Need a defer.inlineCallbacks here as we yield in it: otherwise nothing in the cb gets executed. 2015-01-27 16:00:07 +00:00
David Baker
1d77969124 Unbreak bad presence merge - don't add these blocks together with an and: they're different things. 2015-01-27 15:58:27 +00:00
Kegan Dougal
51449e0665 Add appservice handler and store. Glue together rest > handler > store. 2015-01-27 15:50:28 +00:00
Mark Haines
436513068d Start implementing the non-incremental sync portion of the v2 /sync API 2015-01-26 18:53:31 +00:00
Mark Haines
3186c5bdbc Merge branch 'develop' into client_v2_sync 2015-01-26 16:32:40 +00:00
Mark Haines
7f6f3f9d62 Pass the current time to serialize event, rather than passing an
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.
2015-01-26 16:11:28 +00:00
Mark Haines
0cfb4591a7 Add handler for /sync API 2015-01-26 15:46:31 +00:00
Mark Haines
ada711504e Replace hs.parse_roomalias with RoomAlias.from_string 2015-01-23 13:21:58 +00:00
Mark Haines
1c06c48ce2 Replace hs.parse_roomid with RoomID.from_string 2015-01-23 11:55:12 +00:00
Mark Haines
5759bec43c Replace hs.parse_userid with UserID.from_string 2015-01-23 11:47:15 +00:00
David Baker
5c6189ea3e Merge branch 'develop' into pushers
Conflicts:
	synapse/rest/__init__.py
2015-01-22 17:46:16 +00:00
Mark Haines
5fed042640 Finish renaming "context" to "room_id" in federation codebase 2015-01-16 19:01:03 +00:00
Mark Haines
2bdee98269 Remove temporary debug logging that was accidentally committed 2015-01-16 19:00:40 +00:00
David Baker
e3e2fc3255 Don't make the pushers' event streams cause people to appear online 2015-01-15 16:17:21 +00:00
Paul "LeoNerd" Evans
c2e7c84e58 Don't try to cancel already-expired timers - SYN-230 2015-01-13 16:58:36 +00:00
Paul "LeoNerd" Evans
02ffbb20d0 Use float rather than integer divisions to turn msec into sec - so timeouts under 1000msec will actually work 2015-01-12 19:09:14 +00:00
Paul "LeoNerd" Evans
67d8305aea Make typing notification timeouts print a (debug) logging message 2015-01-12 18:22:00 +00:00
Kegan Dougal
b5924cae04 Add raw query param for scrollback. 2015-01-08 14:37:55 +00:00
Kegan Dougal
edb557b2ad Return the raw federation event rather than adding extra keys for federation data. 2015-01-08 14:28:08 +00:00
Erik Johnston
5940ec993b Add missing continuation indent. 2015-01-08 13:59:29 +00:00
Kegan Dougal
5720ab59e0 Add 'raw' query parameter to expose the event graph and signatures to savvy clients. 2015-01-08 13:57:40 +00:00
Kegan Dougal
333836ff92 PEP8 and pyflakes warnings 2015-01-07 16:18:12 +00:00
Kegan Dougal
4c68460392 SYN-154: Tweak how the m.room.create check is done.
Don't perform the check in auth.is_host_in_room but instead do it in _do_join
and also assert that there are no m.room.members in the room before doing so.
2015-01-07 16:09:00 +00:00
Kegan Dougal
9cb4f75d53 SYN-154: Better error messages when joining an unknown room by ID.
The simple fix doesn't work here because room creation also involves
unknown room IDs. The check relies on the presence of m.room.create for
rooms being created, whereas bogus room IDs have no state events at all.
2015-01-07 15:21:48 +00:00
Erik Johnston
9e5545a6fa RoomsForUser now has sender instead of user_id 2015-01-06 15:53:50 +00:00
Erik Johnston
8a12df8cf3 Merge branch 'erikj-perf' of github.com:matrix-org/synapse into develop 2015-01-06 14:45:57 +00:00
Erik Johnston
76ec154e95 We don't need the full events for get_rooms_for_user_where_membership_is 2015-01-06 14:37:00 +00:00
Mark Haines
5e23a19204 Merge pull request #28 from matrix-org/erikj-perf
Database performance improvements.
2015-01-06 13:33:40 +00:00
Mark Haines
adb04b1e57 Update copyright notices 2015-01-06 13:21:39 +00:00
Erik Johnston
f0128f9600 Add RoomMemberStore.get_users_in_room, so that we can get the list of joined users without having to retrieve the full events 2015-01-06 10:55:43 +00:00
Kegan Dougal
67a406a754 Rate limit display names and avatar urls per request rather than per event. 2014-12-19 17:36:33 +00:00
Mark Haines
efd27ff01b Set a state_key for the topic and room name, otherwise they won't be treated as room state 2014-12-19 15:31:27 +00:00
Mark Haines
f70e622d59 bump_presence_active_time when sending a message event 2014-12-19 14:30:57 +00:00
Mark Haines
a999f0dec3 Don't ratelimit room create events 2014-12-19 14:18:27 +00:00
Mark Haines
1e7f83b91d Set display name when joining via alias 2014-12-19 12:31:46 +00:00
Mark Haines
5739e6c606 s/user_id/sender/ 2014-12-19 11:43:46 +00:00
Mark Haines
041ac476a5 Supply auth_chain along with current state in '/state/', fetch auth events from a remote server if we are missing some of them 2014-12-18 18:47:13 +00:00
Mark Haines
dea5d4b03b Don't yield on sending the event accross federation. 2014-12-18 11:29:46 +00:00
Erik Johnston
21cab3a7ec Fix where we pulled in event.state_events from hotfixes branch 2014-12-16 19:16:15 +00:00
Erik Johnston
2215faa361 Merge branch 'hotfixes-v0.5.4a' of github.com:matrix-org/synapse into release-v0.6.0 2014-12-16 19:11:13 +00:00
Erik Johnston
3defd5b3ee Add FIXME 2014-12-16 19:07:20 +00:00
Erik Johnston
96779d2490 Fix bug where we did not send the full auth chain to people that joined over federation 2014-12-16 18:57:36 +00:00
Erik Johnston
2d7716d4d0 Make error messages slightly more helpful 2014-12-16 18:41:48 +00:00
Mark Haines
56db465047 Merge branch 'release-v0.6.0' into develop 2014-12-16 17:29:49 +00:00
Erik Johnston
f06161a307 Enable rate limiting for all events 2014-12-16 16:10:17 +00:00
Mark Haines
627e4f01d2 Remove send_message since nothing was calling it. Remove Snapshot because only send_message was using it 2014-12-16 16:07:41 +00:00
Mark Haines
c3eae8a88c Construct the EventContext in the state handler rather than constructing one and then immediately calling state_handler.annotate_context_with_state 2014-12-16 15:59:17 +00:00
Mark Haines
3c7857e49b clean up coding style a bit 2014-12-16 15:24:03 +00:00
Erik Johnston
3c77d13aa5 Kill off synapse.api.events.* 2014-12-16 11:29:05 +00:00
Erik Johnston
6a1da99fab Add fixme to raising of AuthError in federation land 2014-12-16 09:35:31 +00:00
Erik Johnston
009e4b5637 User.is_mine is no longer a thing. Use hs.is_mine instead. 2014-12-15 17:17:51 +00:00
Erik Johnston
cf6e5f1dbf Rename MessageHandler.handle_event. Add a few comments. 2014-12-15 17:01:12 +00:00
Erik Johnston
65cdf4e724 Get current member state from current_state snapshot. Fix leave test. 2014-12-15 15:03:27 +00:00
Erik Johnston
57e0e619f3 Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor
Conflicts:
	tests/handlers/test_room.py
2014-12-15 14:45:59 +00:00
Paul "LeoNerd" Evans
20beed9dd4 Still send typing notifications to myself if I'm the only one in the room (it's a lonely life...) 2014-12-15 14:37:12 +00:00
Paul "LeoNerd" Evans
b0bb1756a9 Send list of typing user IDs as 'user_ids' list within 'content', so that m.typing stream events have a toplevel content, for consistency with others 2014-12-12 11:59:46 +00:00
Erik Johnston
63810c777d Validate message, topic and name event contents 2014-12-12 11:01:09 +00:00
Paul "LeoNerd" Evans
cfb963af03 When users leave rooms mark them as no longer typing in them 2014-12-11 18:33:09 +00:00
Paul "LeoNerd" Evans
f25764943c Add a 'user_left_room' distributor signal analogous to 'user_joined_room' 2014-12-11 18:27:01 +00:00
Paul "LeoNerd" Evans
5ebc994f84 Actually auth-check to ensure people can only send typing notifications for rooms they're actually in 2014-12-11 18:11:43 +00:00
Paul "LeoNerd" Evans
966c4b2b04 Add a sprinkling of logger.debug() into typing notification handler 2014-12-11 18:00:15 +00:00
Erik Johnston
d3eb12c7b8 Fix federation test 2014-12-11 17:01:27 +00:00
Paul "LeoNerd" Evans
3b2cc26053 Initial hack at unit tests of room typing REST API 2014-12-11 16:03:12 +00:00
Erik Johnston
0b04369238 Fix public room joining by making sure replaces_state never points to itself. 2014-12-11 15:56:06 +00:00
Paul "LeoNerd" Evans
5f49914dee Avoid cyclic dependency in handler setup 2014-12-10 21:17:48 +00:00
Paul "LeoNerd" Evans
1a75ff5c23 Hook up the event stream to typing notifications 2014-12-10 21:01:49 +00:00
Paul "LeoNerd" Evans
4006d58335 Store serial numbers per room for typing event stream purposes 2014-12-10 20:48:25 +00:00
Paul "LeoNerd" Evans
9eb819e828 First hack at implementing timeouts in typing notification handler 2014-12-10 19:39:01 +00:00
Erik Johnston
4c682143c8 .from_string() no longer takes a HS 2014-12-10 18:00:49 +00:00
Erik Johnston
02e4c18171 Remove dead code 2014-12-10 18:00:36 +00:00
Erik Johnston
b245ee34ed Add some basic event validation 2014-12-10 17:59:47 +00:00
Erik Johnston
1d2a0040cf Fix bug where we clobbered old state group values 2014-12-10 15:55:03 +00:00
Erik Johnston
02db7eb209 Fix bug when uploading state with empty state_key 2014-12-10 14:02:48 +00:00
Erik Johnston
aae8a37e63 Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor 2014-12-10 13:18:40 +00:00
Erik Johnston
02db1fd2e7 Fix AttributeError 2014-12-10 12:00:05 +00:00
Erik Johnston
018443cb59 Make depth increase. 2014-12-10 11:59:53 +00:00
Erik Johnston
95aa903ffa Try and figure out how and why signatures are being changed. 2014-12-10 11:37:47 +00:00
Erik Johnston
008303b245 PEP8 2014-12-09 14:49:11 +00:00
Erik Johnston
5eca288d28 Fix joining from an invite 2014-12-09 14:47:27 +00:00
Erik Johnston
1c8ee06877 Remove unused snapshot 2014-12-09 10:53:34 +00:00
Erik Johnston
4e57943cc5 Remove unused import 2014-12-09 10:51:36 +00:00
Matthew Hodgson
8529fba02d fix a million stupid bugs and make it actually work 2014-12-08 19:34:51 +00:00
Erik Johnston
609c31e8df More bug fixes 2014-12-08 17:50:56 +00:00
Erik Johnston
ee3df06183 More bug fixes 2014-12-08 14:50:48 +00:00
Erik Johnston
e8323b9e34 More bug fixes 2014-12-08 10:16:18 +00:00
Erik Johnston
a295a3c691 Fix registration 2014-12-08 09:24:37 +00:00
Erik Johnston
d044121168 Various typos and bug fixes. 2014-12-08 09:08:26 +00:00
Matthew Hodgson
9c43b258ec actually reset retry schedule if we can successfuly talk to it 2014-12-08 00:17:12 +00:00
Erik Johnston
6630e1b579 Start making more things use EventContext rather than event.* 2014-12-05 16:20:48 +00:00
Erik Johnston
c5c32266d8 Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor 2014-12-04 15:58:24 +00:00
Erik Johnston
c31dba86ec Convert rest and handlers to use new event structure 2014-12-04 15:50:01 +00:00
Erik Johnston
5d7c9ab789 Begin converting things to use the new Event structure 2014-12-04 11:27:59 +00:00
Paul "LeoNerd" Evans
f5d2514fc0 @log_function on PresenceStream's get_new_events_for_user() 2014-12-03 19:48:14 +00:00
Paul "LeoNerd" Evans
52f1d3c886 Store any incoming presence push in the local cache anyway, even if there's no interested observers (yet *hint*) (SYN-115) 2014-12-03 19:06:24 +00:00
Erik Johnston
75b4329aaa WIP for new way of managing events. 2014-12-03 16:07:21 +00:00
Erik Johnston
6941a19715 Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor 2014-12-03 11:56:49 +00:00
Paul "LeoNerd" Evans
274d137b00 Extra verbosity on logging of received presence info 2014-12-02 20:51:28 +00:00
Paul "LeoNerd" Evans
307f94dcbe Squash room_ids list to a set() to remove duplicates - with TODO marker as I have no idea /why/ the dups are happening in the first place 2014-12-02 20:51:12 +00:00
Erik Johnston
9d53228158 Change DomainSpecificString so that it doesn't use a HomeServer object 2014-12-02 10:42:28 +00:00
Erik Johnston
027542e2e5 Fix bugs when joining a remote room that has dodgy event graphs. This should also fix the number of times a HS will trigger a GET /event/ 2014-11-27 16:02:26 +00:00
Erik Johnston
0294fba042 on_receive_pdu takes more args 2014-11-27 14:46:33 +00:00
Erik Johnston
07699b5871 Change the way we get missing auth and state events 2014-11-27 14:31:43 +00:00
Erik Johnston
b8849c8cbf Re-sign events when we return them via federation as a temporary hack to work around the problem where we reconstruct events differently than when they were signed 2014-11-27 13:53:31 +00:00
Erik Johnston
00ab5cd6f2 Attempt to fix bug where we 500d an event stream due to trying to cancel a timer twice 2014-11-26 18:04:33 +00:00
Erik Johnston
858e87ab0d Add a workaround for bug where some initial join events don't reference creation events in their auth_events 2014-11-26 16:29:03 +00:00
Erik Johnston
6c485c282d Catch exceptions when trying to add an entry to rooms tables 2014-11-26 16:06:20 +00:00
Erik Johnston
3598c11c8d Correctly handle the case where we get an event for an unknown room, which turns out we are actually in 2014-11-26 10:41:08 +00:00
Erik Johnston
64fc859dac Fix bugs in invite/join dances.
We now do more implement more of the auth on the events so that we
don't reject valid events.
2014-11-25 17:59:49 +00:00
Erik Johnston
4bd0ab76c6 We don't always want to Auth get_persisted_pdu 2014-11-24 12:56:17 +00:00
Mark Haines
fd40a80a68 Return 404 M_NOT_FOUND when trying to look up a room alias that doesn't exist 2014-11-21 15:11:48 +00:00
Paul "LeoNerd" Evans
5f19c55731 SYN-58: Allow passing explicit limit=0 to initialSync to request no messages at all; missing still implies default 10 2014-11-20 19:33:45 +00:00
Mark Haines
610c2ea131 Fix pep8 and pyflakes warnings 2014-11-20 18:00:10 +00:00
David Baker
f1c7f8e813 Merge branch 'develop' into http_client_refactor 2014-11-20 17:49:48 +00:00
David Baker
e377d33652 Separate out the matrix http client completely because just about all of its code it now separate from the simple case we need for standard HTTP(S) 2014-11-20 17:41:56 +00:00
Mark Haines
db9ce032a4 Fix pep8 codestyle warnings 2014-11-20 17:26:36 +00:00
Mark Haines
32090aee16 Add a few missing yields, Move deferred lists inside PreserveLoggingContext because they don't interact well with the logging contexts 2014-11-20 16:24:00 +00:00
David Baker
20326054da Oops, I removed this param. 2014-11-20 15:24:38 +00:00
David Baker
dc60eee50e Refactor the HTTP clients a little. 2014-11-20 13:53:34 +00:00
Mark Haines
dcb99e4972 SYN-153: Fix formatting of federation error message 2014-11-20 09:58:23 +00:00
Erik Johnston
415ddf59bb Don't add a 'prev' key to m.room.member messages 2014-11-19 17:59:51 +00:00
Paul "LeoNerd" Evans
03dc63f6c8 Initialise UserPresenceCache instances to always contain a 'presence' key 2014-11-19 17:31:46 +00:00
Mark Haines
8993affdc0 SYN-153: Raise 404 if room alias is not found 2014-11-19 17:14:14 +00:00
Mark Haines
97c7c34f6f Preserve logging context in a few more places, drop the logging context after it has been stashed to reduce potential for confusion 2014-11-19 16:37:43 +00:00
Mark Haines
54c438d8d3 Remove unused variable 2014-11-18 16:46:12 +00:00
Paul "LeoNerd" Evans
75e95c45a2 Rename message handler's new snapshot_room to room_initial_sync() as that better suits its purpose 2014-11-18 16:02:44 +00:00
Paul "LeoNerd" Evans
e9f587ecba Merge remote-tracking branch 'origin/develop' into room-initial-sync 2014-11-18 15:48:30 +00:00
Mark Haines
b01dd76be1 SYN-149: Enable auth for events added during room creation since they should pass auth checks 2014-11-18 15:42:53 +00:00
Mark Haines
ae9c2ab165 SYN-149: Send join event immediately after the room create event 2014-11-18 15:29:48 +00:00
Paul "LeoNerd" Evans
33d328d967 Include room members' presence in room initialSync 2014-11-18 15:28:58 +00:00
Paul "LeoNerd" Evans
759db7d7d5 Added ability to .get_state() from the PresenceHandler by returning a complete m.presence event 2014-11-18 15:25:55 +00:00
Paul "LeoNerd" Evans
4c18e08036 Don't expect all _user_cachemap entries to definitely contain a "last_active" key 2014-11-18 15:10:11 +00:00
Mark Haines
a5b88c489e Split out sending the room alias events from creating the alias so that we can do them in the right point when creating a room 2014-11-18 15:03:13 +00:00
Paul "LeoNerd" Evans
17f977a9de Include 'messages' snapshot in room initialSync 2014-11-18 14:07:51 +00:00
Paul "LeoNerd" Evans
31a049eb69 Merge branch 'develop' into room-initial-sync
Conflicts:
	synapse/handlers/message.py
2014-11-17 16:59:24 +00:00
Mark Haines
cf45e57d9c SYN-148: Add the alias after creating the room 2014-11-17 16:37:33 +00:00
Mark Haines
2eaf689f71 These lines aren't doing anything 2014-11-17 10:41:35 +00:00
Mark Haines
cb4b6c844a Merge PDUs and Events into one object 2014-11-14 21:25:02 +00:00
Mark Haines
8c2b5ea7c4 Fix PDU and event signatures 2014-11-14 19:11:04 +00:00
Mark Haines
de1ec90133 Validate signatures on incoming events 2014-11-14 19:11:04 +00:00
Erik Johnston
b2596c660b Add a few more comments to the federation handler 2014-11-12 16:20:30 +00:00
Erik Johnston
6fea478d2e Fix bugs with invites/joins across federatiom.
Both in terms of auth and not trying to fetch missing PDUs for invites,
joins etc.
2014-11-12 11:24:11 +00:00
Erik Johnston
61ecb13bf0 PEP8ify 2014-11-11 18:00:13 +00:00
Erik Johnston
37900a92db Only allow people in a room to look up room state. 2014-11-11 17:55:32 +00:00
Erik Johnston
3db2c0d43e Rename annotate_state_groups to annotate_event_with_state 2014-11-11 16:58:53 +00:00
Erik Johnston
5ff0bfb81d Fix bug where we /always/ created a new state group 2014-11-11 14:16:41 +00:00
Paul "LeoNerd" Evans
c23afed39a Include room membership in room initialSync 2014-11-10 19:34:47 +00:00
Paul "LeoNerd" Evans
1fd8139138 Put room state in room initialSync output - I guess this is right; I really can't find any other tests similar... 2014-11-10 19:29:58 +00:00
Paul "LeoNerd" Evans
269f80bf8e Have room initialSync return the room's room_id 2014-11-10 19:02:19 +00:00
Erik Johnston
a8e565eca8 Add an EventValidator. Fix bugs in auth ++ storage 2014-11-10 18:25:42 +00:00
Erik Johnston
5d439b127b PEP8 2014-11-10 13:46:44 +00:00
Erik Johnston
003668cfaa Add auth to the various server-server APIs 2014-11-10 13:37:24 +00:00
Erik Johnston
6447db063a Fix backfill to work. Add auth to backfill request 2014-11-10 11:59:51 +00:00
Erik Johnston
65f846ade0 Notify users about invites. 2014-11-10 11:15:02 +00:00
Erik Johnston
07286a73b1 Use current state to get room hosts, rather than querying the database 2014-11-07 16:03:31 +00:00
Erik Johnston
02c3b1c9e2 Add '/event_auth/' federation api 2014-11-07 15:35:53 +00:00
Erik Johnston
d2fb2b8095 Implement invite part of invite join dance 2014-11-07 13:41:00 +00:00
Erik Johnston
3b4dec442d Return auth chain when handling send_join 2014-11-07 11:22:12 +00:00
Erik Johnston
49948d72f3 Fix joining over federation 2014-11-07 10:53:38 +00:00