Add conversation requests list
- Add routes to REST API for conversation requests
- Add websocket notification on new conversation requests. This is unreliable.
- Rename 'ColoredCallButton' as 'ColoredRoundButton' and move it to Buttons file for reuse
- Review logic to show conversation tabs
- Add useConversationDisplayNameShort for conversations' names in lists. Will need more work.
- Add hooks to help managing React Query's cache
- Use React Query to remove conversations and update the cache doing so.
- Add ContactService and ConversationService as a way to group reusable functions for the server. This is inspired by jami-android
Known bug: The server often freezes on getContactFromUri (in ContactService) when a new conversation request is received.
Change-Id: I46a60a401f09c3941c864afcdb2625b5fcfe054a
diff --git a/common/src/enums/websocket-message-type.ts b/common/src/enums/websocket-message-type.ts
index 37036b9..512c1dc 100644
--- a/common/src/enums/websocket-message-type.ts
+++ b/common/src/enums/websocket-message-type.ts
@@ -17,6 +17,7 @@
*/
export enum WebSocketMessageType {
ConversationMessage = 'conversation-message',
+ ConversationRequest = 'conversation-request',
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
diff --git a/common/src/interfaces/conversation.ts b/common/src/interfaces/conversation.ts
index f49f72e..1304adc 100644
--- a/common/src/interfaces/conversation.ts
+++ b/common/src/interfaces/conversation.ts
@@ -69,3 +69,11 @@
membersNames: string[];
lastMessage: Message;
}
+
+export interface IConversationRequest {
+ conversationId: string;
+ infos: ConversationInfos;
+ from: IContact;
+ received: string;
+ membersNames: string[];
+}
diff --git a/common/src/interfaces/websocket-message.ts b/common/src/interfaces/websocket-message.ts
index af3078c..d633059 100644
--- a/common/src/interfaces/websocket-message.ts
+++ b/common/src/interfaces/websocket-message.ts
@@ -16,6 +16,7 @@
* <https://www.gnu.org/licenses/>.
*/
import { WebSocketMessageType } from '../enums/websocket-message-type.js';
+import { IConversationRequest } from './conversation.js';
import {
CallAction,
CallBegin,
@@ -28,6 +29,7 @@
export interface WebSocketMessageTable {
[WebSocketMessageType.ConversationMessage]: ConversationMessage;
+ [WebSocketMessageType.ConversationRequest]: IConversationRequest;
[WebSocketMessageType.ConversationView]: ConversationView;
[WebSocketMessageType.OnComposingStatusChanged]: ComposingStatus;
[WebSocketMessageType.SetIsComposing]: ComposingStatus;