From 9dfea26a7eca9810737d7bd50a43fbd457b9cf90 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Sat, 5 Sep 2020 23:40:50 +0400 Subject: [PATCH] Remove unneccessary info in typing message feature --- protocol-spec/private-chats.md | 70 ++++------------------------------ 1 file changed, 7 insertions(+), 63 deletions(-) diff --git a/protocol-spec/private-chats.md b/protocol-spec/private-chats.md index 9a99f5b..5b4d8fe 100644 --- a/protocol-spec/private-chats.md +++ b/protocol-spec/private-chats.md @@ -197,7 +197,7 @@ This extension is intended for organizing private chat between two users. } ``` -### 5.3. Typing messages +### 5.3. Typing message 1. Typing message @@ -206,9 +206,7 @@ This extension is intended for organizing private chat between two users. "id": "abcd", "type": "urn:cadmium:chats:private:typing", "to": ["@user1@cadmium.org"], - "payload": { - "status": "typing", - } + "payload": {} } ``` @@ -220,42 +218,15 @@ This extension is intended for organizing private chat between two users. "type": "urn:cadmium:chats:private:read", "from": "@user2@cadmium.im", "ok": true, - "payload": { - "status": "typing" - } - } - ``` - -3. Pause typing message (e.g. when user stops abruptly typing message or just sent the message) - - ```json - { - "id": "abcd", - "type": "urn:cadmium:chats:private:typing", - "to": ["@user1@cadmium.org"], - "payload": { - "status": "paused", - } - } - ``` - -4. Receive notification pausing typing message on other side: - - ```json - { - "id": "defg", - "type": "urn:cadmium:chats:private:read", - "from": "@user2@cadmium.im", - "ok": true, - "payload": { - "status": "paused" - } + "payload": {} } ``` ## 6. Business Rules -None. +### 6.1. Typing message notification + +- Client sends typing notification message every second when he is typing. If there is no notifications about typing more than one second then consider that user is stopped the typing. ## 7. JSON Schema @@ -345,31 +316,4 @@ None. interface ReceiveReadMessageNotifPayload { messageID: string; // the message id of read message } -``` - -### Typing message (`urn:cadmium:chats:private:typing`) - -**Request**: - -```typescript -interface TypingMessagePayload { - status: TypingStatus; // the status of the typing -} - -enum TypingStatus { - typing, - paused -} -``` - -**Response**: - -None. - -### Receive read message notification (`urn:cadmium:chats:private:typing`) - -```typescript -interface TypingMessageNotifPayload { - status: TypingStatus; // the status of the typing -} -``` +``` \ No newline at end of file