Divide Conversation into ConversationInfos, ConversationMember, and ConversationSummary
- ConversationSummary is used to display ConversationList.
- Having the three separated will help managing queries.
- Adding ConversationSummary required to solve some inconsistencies in ConversationList, which was mixing contacts and conversations. ContactSearchResultList has been added as a quick fix . It will need more work.
- Some tools to uniformize conversation names have been introduced. They will need more work.
Note the diplaying of ConversationList is left broken in this commit.
Change-Id: I29337906cc43781a9c4790735490a6ee2cc51cb0
diff --git a/common/src/interfaces/conversation.ts b/common/src/interfaces/conversation.ts
index 5fe2145..dab9dd0 100644
--- a/common/src/interfaces/conversation.ts
+++ b/common/src/interfaces/conversation.ts
@@ -17,13 +17,6 @@
*/
import { IContact } from './contact';
-export interface IConversation {
- id: string;
- members: IConversationMember[];
- messages: Message[];
- infos: ConversationInfos;
-}
-
export interface IConversationMember {
role?: ConversationMemberRole;
contact: IContact;
@@ -53,6 +46,8 @@
}
export interface ConversationInfos {
+ avatar?: string;
+ description?: string;
mode?: string;
title?: string;
}
@@ -64,3 +59,11 @@
export interface NewMessageRequestBody {
message: string;
}
+
+export interface IConversationSummary {
+ id: string;
+ avatar: ConversationInfos['avatar'];
+ title: ConversationInfos['title'];
+ membersNames: string[];
+ lastMessage: Message;
+}