[WIP] Start making bare-bones /sync reply schema.
Some checks are pending
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Waiting to run
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Waiting to run

This commit is contained in:
lda 2024-06-09 02:13:49 +02:00
parent a491a740d4
commit 00311f58dc
2 changed files with 106 additions and 3 deletions

105
Schema/SyncResponse.json Normal file
View file

@ -0,0 +1,105 @@
{
"guard": "TELODENDRIA_SCHEMA_SYNCRESPONSE_H",
"header": "Schema\/SyncResponse.h",
"types": {
"Event": {
"fields": {
"content": {
"type": "object",
"required": true
},
"type": {
"type": "string",
"required": true
}
},
"type": "struct"
},
"AccountData": {
"fields": {
"events": { "type": "[Event]" }
},
"type": "struct"
},
"StrippedStateEvent": {
"fields": {
"events": { "type": "[Event]" }
},
"type": "struct"
},
"InviteState": {
"fields": {
"content": {
"type": "object",
"required": true
},
"sender": {
"type": "string",
"required": true
},
"state_key": {
"type": "string",
"required": true
},
"type": {
"type": "string",
"required": true
}
},
"type": "struct"
},
"InvitedRooms": {
"fields": {
"invite_state": { "type": "InviteState" }
},
"type": "struct"
},
"ClientEventWithoutRoomID": {
"fields": {
"content": { "type": "object", "required": true },
"event_id": { "type": "string", "required": true },
"origin_server_ts": { "type": "integer", "required": true },
"sender": { "type": "string", "required": true },
"state_key": { "type": "string" },
"type": { "type": "string", "required": true }
},
"type": "struct"
},
"Timeline": {
"fields": {
"events": { "type": "[ClientEventWithoutRoomID]", "required": true },
"limited": { "type": "boolean" },
"prev_batch": { "type": "string" }
},
"type": "struct"
},
"JoinedRooms": {
"fields": {
"timeline": { "type": "Timeline" }
},
"type": "struct"
},
"Rooms": {
"fields": {
"invite": { "type": "InvitedRooms" },
"join": { "type": "JoinedRooms" }
},
"type": "struct"
},
"SyncResponse": {
"fields": {
"next_batch": {
"type": "string",
"required": true
},
"account_data": {
"type": "AccountData"
},
"rooms": {
"type": "Rooms"
}
},
"type": "struct"
}
}
}

View file

@ -1812,9 +1812,7 @@ RoomAddEventV1(Room *room, PduV1 pdu)
DbUnlock(room->db, event_ref); DbUnlock(room->db, event_ref);
/* TODO: Store DAG relationships, somehow. /* TODO: Store DAG relationships, somehow. */
* Also keep track of PDU depth. */
pdu_json = PduV1ToJson(&pdu); pdu_json = PduV1ToJson(&pdu);
{ {
CommonID *sid= UserIdParse(pdu.sender, NULL); CommonID *sid= UserIdParse(pdu.sender, NULL);