Add composing notification
Change-Id: I2c052c4395a56ba6acf882cea3be4b82e2fde761
diff --git a/common/src/enums/websocket-message-type.ts b/common/src/enums/websocket-message-type.ts
index 38d2042..37036b9 100644
--- a/common/src/enums/websocket-message-type.ts
+++ b/common/src/enums/websocket-message-type.ts
@@ -18,6 +18,8 @@
export enum WebSocketMessageType {
ConversationMessage = 'conversation-message',
ConversationView = 'conversation-view',
+ OnComposingStatusChanged = 'on-composing-status-changed', // Sent by server to indicate who is composing a message or not
+ SetIsComposing = 'set-is-composing', // Sent by user to indicate whether they are composing a message or not
CallBegin = 'call-begin',
CallAccept = 'call-accept',
CallEnd = 'call-end',
diff --git a/common/src/interfaces/websocket-interfaces.ts b/common/src/interfaces/websocket-interfaces.ts
index 109adce..f680e16 100644
--- a/common/src/interfaces/websocket-interfaces.ts
+++ b/common/src/interfaces/websocket-interfaces.ts
@@ -30,6 +30,12 @@
conversationId: string;
}
+export interface ComposingStatus {
+ contactId?: string; // optional (ignored) when is about the user sending it
+ conversationId: string;
+ isWriting: boolean;
+}
+
export interface CallAction extends ContactMessage {
conversationId: string;
}
diff --git a/common/src/interfaces/websocket-message.ts b/common/src/interfaces/websocket-message.ts
index c42fc44..af3078c 100644
--- a/common/src/interfaces/websocket-message.ts
+++ b/common/src/interfaces/websocket-message.ts
@@ -19,6 +19,7 @@
import {
CallAction,
CallBegin,
+ ComposingStatus,
ConversationMessage,
ConversationView,
WebRtcIceCandidate,
@@ -28,6 +29,8 @@
export interface WebSocketMessageTable {
[WebSocketMessageType.ConversationMessage]: ConversationMessage;
[WebSocketMessageType.ConversationView]: ConversationView;
+ [WebSocketMessageType.OnComposingStatusChanged]: ComposingStatus;
+ [WebSocketMessageType.SetIsComposing]: ComposingStatus;
[WebSocketMessageType.CallBegin]: CallBegin;
[WebSocketMessageType.CallAccept]: CallAction;
[WebSocketMessageType.CallEnd]: CallAction;