-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved "getting events for a room" #132
Conversation
…pses work (usage of different tables)
const roomId: string = (req as Request).params.roomId | ||
const eventType = (req as Request).params.eventType | ||
const stateKey = (req as Request).params.stateKey | ||
// TODO : add check for eventType |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
* Following the spec and Synapse implementation of the matrix Protocol, we have decided that when the requesting user | ||
* left the room, he will have access solely to the event of his departure. | ||
* | ||
* TODO : eventually add check for eventType to prevent invalid requests in the database |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
/* istanbul ignore next */ | ||
send(res, 500, errMsg('unknown', err)) | ||
}) | ||
// TODO : eventually serialize the event before sending it to client as done in Synapse implementation |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
clientServer.authenticate(req, res, (token) => { | ||
const requesterUid = token.sub | ||
|
||
// TODO : eventually add redirection with federation here |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
epoch() - | ||
(eventResult[0].events_origin_server_ts as number), | ||
prev_content: eventResult[0].events_prev_content | ||
// TODO : Add more unsigned data cf https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidstate |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
const unsigned = { | ||
age: epoch() - (eventResult[0].origin_server_ts as number), | ||
prev_content: eventResult[0].prev_content | ||
// TODO : Add more unsigned data cf https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidstate |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
* Following the spec and Synapse implementation of the matrix Protocol, we have decided that when the requesting user | ||
* left the room, he will have access solely to the event of his departure. | ||
* | ||
* TODO : eventually add check for eventType to prevent invalid requests in the database |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
Following Synapse implementation of the matrix Protocol and their usage of the synapse database, we have improved the existing APIs :
-https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3roomsroomideventeventid
-https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3roomsroomidjoined_members
Then added 2 more :
-https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3roomsroomidstate
-https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3roomsroomidstateeventtypestatekey