Commit graph

27 commits

Author SHA1 Message Date
ruben 74827428bd use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
Alex Chen e063433b74 Fix POST /get_missing_events/{roomId} #622 (#678)
* Fix #622 /get_missing_events/{roomId}

Signed-off-by: Alex Chen <minecnly@gmail.com>

* Set initial size for eventsToFilter in /get_missing_events/{roomId}

Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-01-14 10:20:19 +00:00
Brendan Abolivier 56058b9469
Implement the /backfill federation endpoint (#585)
* Implement the /backfill federation endpoint

* Make the BFS loop block common between QueryMissingEvents and QueryPreviousEvents

* Improve comments on the BFS loop block

* Optimisation: prevent unnecessary redefinitions/reallocations

* Add trailing slash at the end of the route for parity with synapse

* Replace QueryPreviousEvents with QueryBackfill

* Change the backfill response to comply with the specs and synapse's behaviour
2018-11-07 11:38:01 +00:00
Anant Prakash d4b24462d1
return err when err != nil (#545) 2018-07-11 17:46:38 +05:30
Anant Prakash c8feee7354
[roomserver] Add internal API QueryMembershipForUser (#544)
* Add internal API QueryMembershipForUser

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>

* Change sender to user_id
2018-07-11 15:40:37 +05:30
Anant Prakash 262fc25aca
[federation] Implement get missing events api (#516)
* [federation] implement get_missing_events

* Check that events are viewable by the server

* Explain filterEvents
2018-06-26 15:55:49 +05:30
Scott Raine c9add39768 Use http.Status* and http.Method* where appropriate (#417)
Signed-off-by: Scott Raine <me@nylar.io>
2018-03-13 15:55:45 +00:00
Erik Johnston 9e352e7311
Implement query to get state and auth chain (#352)
* Implement query to get state and auth chain

* Add routing for queryStateAndAuthChain

* Comments

* Fix fetching wrong set of events

* Add tests

* Shuffle and comment
2017-11-27 10:20:00 +00:00
Mark Haines c4947c2ffb Add opentracing Spans to the HTTP APIs (#270)
* Add opentracing Spans to the HTTP APIs

* Add opentracing spans to the HTTP RPC clients

* Set the span in the request context

* More docstring
2017-09-28 14:50:40 +01:00
Mark Haines bfcce5bd21 Add contexts to the roomserver storage layer (#229)
* Add contexts to the roomserver storage layer

* Fix rooms_table
2017-09-13 16:30:19 +01:00
Mark Haines 3133bef797 Add contexts to the internal roomserver APIs (#228) 2017-09-13 13:37:50 +01:00
Erik Johnston ea80ffb3af Add get event federation API (#209)
* Add get event federation API

* Handle err correctly

* Add missing readers

* Ignore gocyclo lint for routing function

* Add todo

* Fix styling a bit
2017-09-06 12:38:22 +01:00
Brendan Abolivier 685e056ab3 Membership viewing API when user left the room (#194)
* Implement case where user left the room

* Filter by membership event

* Move the logic from the storage to the query API

* Fix check on state entries iteration

* Remove aliases methods from query API

* Use structure for response to match with the spec

* Remove filtering on /members and implement /joined_members
2017-08-24 16:00:14 +01:00
Mark Haines 17c60759c4 Add query API for listing active invites (#196)
* Add query API for listing active invites

This lists the invites for a user in a room that could be used to
join the room over federation.

* s/Lookup/Look up/

* Fix implements comments
2017-08-23 15:08:48 +01:00
Brendan Abolivier 5950293e79 Membership viewing API (#174)
* Basic memberships retrieval

* Change the way the memberships are saved in the client API database

* Retrieve single membership

* Get memberships only if the user is or has been in the room

* Check server name on room ID instead of user ID

* Save the join membership event and updates it when necessary

* Membership events retrieval + update on leave

* Implement the API on the roomserver and client API server

* Fix comments

* Remove the functions and attributes used before the new query API

* Explicitely state what we return in query

* Remove tab
2017-08-21 16:34:26 +01:00
Brendan Abolivier c7e36ba2a1 Implement room aliases (#167)
* Add database functions to interact with aliases

* Save room alias

* Check if alias already exists

* Implement local alias lookup

* Implement alias removal

* Move alias API

* Handle case with no alias set for a room

* Apply requested changes
2017-07-28 11:31:43 +01:00
Mark Haines d3a29b7816 Add a HTTP API for roomserver input (#158)
* Add a HTTP API for roomserver input

* Fix integration tests
2017-07-13 11:41:30 +01:00
Mark Haines 54e7e3041b Set depth of events and whether they need to be federated. (#145)
* Set depth of events and whether they need to be federated.

Set the depth of each new event to one greater than the maximum depth
of it's direct ancestors.

Add a flag to each event passing through the roomserver that tells us
whether the event needs to be sent over federation.

We do this by passing the name of the server to send the event as.
We will need this capability if we want to support vhosting as it is
not possible to tell from the event alone which server to send it as.

(The reason for this is that sometimes a event needs to be sent on
behalf of a different remote matrix server)

* Update roomserver integration tests

* More comments

* Constants and comments

* Fix comments

* Document the int64 returned by LatestEventIDs
2017-06-27 15:28:44 +01:00
Mark Haines 515cce1a45 Add support for receiving room events over federation. (#130)
* Add API for querying events by ID.

* Fix tense

* Start implementing federation ingress

* More stuff

* Hook up federation event receiving

* Handle the case where we are missing state

* Fix docstring and comments

* Fix infinite loop when printing unknownRoomError
2017-06-07 14:32:53 +01:00
Mark Haines ef7b934d51 Add Query API for querying events by ID (#129) 2017-06-02 14:32:36 +01:00
Mark Haines 1b6e06aa59 Revert "Add API for querying events by ID. (#127)" (#128)
This reverts commit ce82158abb.
2017-06-02 14:24:13 +01:00
Mark Haines ce82158abb Add API for querying events by ID. (#127)
* Add API for querying events by ID.

* Fix tense

* Start implementing federation ingress

* More stuff

* Hook up federation event receiving

* Fix comments

* Comment on the order of the arrays
2017-06-02 11:19:34 +01:00
Mark Haines 65b66a6452 Add API for querying the state after a list of events (#123)
* Add API for querying the state after a list of events

* Implement state after events API

* Actually implement the API

* Reorder .travis.yml

* Comments

* Use common.MakeAPI
2017-05-30 17:44:31 +01:00
Mark Haines a96b124158 Move calculate state to the state package (#121) 2017-05-26 13:51:54 +01:00
Robert Swain d09a65abbe Add Apache Version 2.0 license and headers to all golang files 2017-04-21 00:40:52 +02:00
Mark Haines e667f17e14 Include the requested current state alongside the latest events in the query API. (#30)
* Return the requested portions of current state in the query API

* Use Unique from github.com/matrix-org/util

* rewrite bulkSelectFilteredStateBlockEntries to use append for clarity

* Add test for stateKeyTupleSorter

* Replace current with a new StateEntryList rather than individually setting the fields
2017-03-09 15:07:18 +00:00
Mark Haines 9a8a8aedcb Add a query API to the roomserver for getting the latest events in a room. (#23)
* Start implementing a query API for go using net/rpc

* Use a conventional JSON POST API rather than go net/rpc

net/rpc doesn't automatically handle reconnecting and we have better
logging and metrics infrastructure for monitoring HTTP apis.

* Implement the query API and add it to the integration tests

* Increase the timeout, travis seems to be a bit slow

* Clarify that state events are the things that are not returned if they are not requested

* Add utility function for converting arrays of numeric event IDs to pq Int64Arrays

* Warn people against requesting empty state keys by accident
2017-03-06 14:29:39 +00:00