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/server/src/jamid/jami-swig.ts b/server/src/jamid/jami-swig.ts
index df9dd3d..d8f0dcb 100644
--- a/server/src/jamid/jami-swig.ts
+++ b/server/src/jamid/jami-swig.ts
@@ -117,6 +117,7 @@
conversationInfos(accountId: string, conversationId: string): StringMap;
getConversationMembers(accountId: string, conversationId: string): VectMap;
acceptConversationRequest(accountId: string, conversationId: string): void;
+ removeConversation(accountId: string, conversationId: string): void;
sendMessage(accountId: string, conversationId: string, message: string, replyTo: string, flag: number): void;
loadConversationMessages(accountId: string, conversationId: string, fromMessage: string, n: number): number;
diff --git a/server/src/jamid/jamid.ts b/server/src/jamid/jamid.ts
index b6a728b..2476e72 100644
--- a/server/src/jamid/jamid.ts
+++ b/server/src/jamid/jamid.ts
@@ -345,8 +345,13 @@
) as unknown as ConversationMemberInfos[];
}
- async getConversationMessages(accountId: string, conversationId: string, fromMessage?: string): Promise<Message[]> {
- const requestId = this.jamiSwig.loadConversationMessages(accountId, conversationId, fromMessage || '', 32);
+ async getConversationMessages(
+ accountId: string,
+ conversationId: string,
+ fromMessage = '',
+ n = 32
+ ): Promise<Message[]> {
+ const requestId = this.jamiSwig.loadConversationMessages(accountId, conversationId, fromMessage, n);
return firstValueFrom(
this.events.onConversationLoaded.pipe(
filter((value) => value.id === requestId),
@@ -355,6 +360,10 @@
);
}
+ removeConversation(accountId: string, conversationId: string) {
+ this.jamiSwig.removeConversation(accountId, conversationId);
+ }
+
sendConversationMessage(
accountId: string,
conversationId: string,