SPEC-4: Update

This commit is contained in:
ChronosX88 2020-01-03 14:16:58 +04:00
parent 8e41c7532d
commit 1cd3b60334
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 10 additions and 17 deletions

View File

@ -4,7 +4,7 @@
This proposal introduces the concept of chats (this proposal describes only private chats) and a mechanism for sending/receiving messages in the chat. This proposal introduces the concept of chats (this proposal describes only private chats) and a mechanism for sending/receiving messages in the chat.
![Message Mindmap](CPP3 - Message Mindmap.png) ![Message Mindmap](./CPP3-img.png)
## Message type identifiers ## Message type identifiers
@ -33,10 +33,9 @@ Note: C - client, S - server
"id": "abcd", "id": "abcd",
"type": "chat:create", "type": "chat:create",
"from": "@user1@cadmium.im", "from": "@user1@cadmium.im",
"to": "cadmium.im", "to": "@user2@cadmium.im",
"payload": { "payload": {
"chatType": "user", "chatType": "user"
"receiverUserId": "@user2@cadmium.im"
} }
} }
``` ```
@ -78,12 +77,11 @@ Error response (S):
{ {
"id": "abcd", "id": "abcd",
"type": "chat:created", "type": "chat:created",
"from": "cadmium.im", "from": "@user1@cadmium.im",
"to": "@user2@cadmium.im", "to": "@user2@cadmium.im",
"ok": true, "ok": true,
"payload": { "payload": {
"roomId": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im", "roomId": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im"
"creatorUserId": "@user1@cadmium.im"
} }
} }
``` ```
@ -111,7 +109,7 @@ Error response (S):
{ {
"id": "abcd", "id": "abcd",
"type": "message:send", "type": "message:send",
"from": "cadmium.im", "from": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im",
"to": "@user1@cadmium.im", "to": "@user1@cadmium.im",
"ok": true, "ok": true,
"payload": { "payload": {
@ -127,7 +125,7 @@ Error response (S):
{ {
"id": "abcd", "id": "abcd",
"type": "message:receive", "type": "message:receive",
"from": "cadmium.im", "from": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im",
"to": "@user2@cadmium.im", "to": "@user2@cadmium.im",
"ok": true, "ok": true,
"payload": { "payload": {
@ -160,7 +158,7 @@ Error response (S):
{ {
"id": "abcd", "id": "abcd",
"type": "message:read", "type": "message:read",
"from": "cadmium.im", "from": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im",
"to": "@user2@cadmium.im", "to": "@user2@cadmium.im",
"ok": true, "ok": true,
"payload": {} "payload": {}
@ -173,7 +171,7 @@ Error response (S):
{ {
"id": "abcd", "id": "abcd",
"type": "message:receive:read", "type": "message:receive:read",
"from": "cadmium.im", "from": "!22c5d942-22bc-45b3-9541-ec2b49afe5ec@cadmium.im",
"to": "@user1@cadmium.im", "to": "@user1@cadmium.im",
"ok": true, "ok": true,
"payload": { "payload": {
@ -238,12 +236,7 @@ interface CreatePrivateChatNotificationPayload {
/** /**
* Identifier of newly created chat * Identifier of newly created chat
*/ */
roomId: EntityID, roomId: EntityID
/**
* Identifier of user which created this chat
*/
creatorUserId: EntityID
} }
``` ```

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB