@wireapp/core 17.32.0 → 17.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.33.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@17.32.0...@wireapp/core@17.33.0) (2021-12-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * **core:** Add a method to get all participants/clients of a conversation ([#4193](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/issues/4193)) ([e6a1a90](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/commit/e6a1a90a5c3115c3a2c1c1a793897605eb54da8e))
12
+
13
+
14
+
15
+
16
+
6
17
  # [17.32.0](https://github.com/wireapp/wire-web-packages/tree/main/packages/core/compare/@wireapp/core@17.31.7...@wireapp/core@17.32.0) (2021-12-06)
7
18
 
8
19
 
package/package.json CHANGED
@@ -69,6 +69,6 @@
69
69
  "test:project": "yarn dist && yarn test",
70
70
  "test:node": "nyc jasmine --config=jasmine.json"
71
71
  },
72
- "version": "17.32.0",
73
- "gitHead": "366700148a59834eadd0b3081c349ce4bc79491a"
72
+ "version": "17.33.0",
73
+ "gitHead": "bcbc4dc285bee59367258659ad0d9a9e85bbf6fa"
74
74
  }
@@ -109,6 +109,16 @@ export declare class ConversationService {
109
109
  private generateCallGenericMessage;
110
110
  private generateTextGenericMessage;
111
111
  clearConversation(conversationId: string, timestamp?: number | Date, messageId?: string, sendAsProtobuf?: boolean, conversationDomain?: string): Promise<ClearConversationMessage>;
112
+ /**
113
+ * Get a fresh list from backend of clients for all the participants of the conversation.
114
+ * This is a hacky way of getting all the clients for a conversation.
115
+ * The idea is to send an empty message to the backend to absolutely no users and let backend reply with a mismatch error.
116
+ * We then get the missing members in the mismatch, that is our fresh list of participants' clients.
117
+ *
118
+ * @param {string} conversationId
119
+ * @param {string} conversationDomain? - If given will send the message to the new qualified endpoint
120
+ */
121
+ getAllParticipantsClients(conversationId: string, conversationDomain?: string): Promise<UserClients | QualifiedUserClients>;
112
122
  deleteMessageLocal(conversationId: string, messageIdToHide: string, sendAsProtobuf?: boolean, conversationDomain?: string): Promise<HideMessage>;
113
123
  deleteMessageEveryone(conversationId: string, messageIdToDelete: string, userIds?: string[] | QualifiedId[] | UserClients | QualifiedUserClients, sendAsProtobuf?: boolean, conversationDomain?: string, callbacks?: MessageSendingCallbacks): Promise<DeleteMessage>;
114
124
  leaveConversation(conversationId: string): Promise<ConversationMemberLeaveEvent>;
@@ -457,6 +457,40 @@ class ConversationService {
457
457
  type: conversation_2.PayloadBundleType.CONVERSATION_CLEAR,
458
458
  };
459
459
  }
460
+ /**
461
+ * Get a fresh list from backend of clients for all the participants of the conversation.
462
+ * This is a hacky way of getting all the clients for a conversation.
463
+ * The idea is to send an empty message to the backend to absolutely no users and let backend reply with a mismatch error.
464
+ * We then get the missing members in the mismatch, that is our fresh list of participants' clients.
465
+ *
466
+ * @param {string} conversationId
467
+ * @param {string} conversationDomain? - If given will send the message to the new qualified endpoint
468
+ */
469
+ getAllParticipantsClients(conversationId, conversationDomain) {
470
+ const sendingClientId = this.apiClient.validatedClientId;
471
+ const recipients = {};
472
+ const text = new Uint8Array();
473
+ return new Promise(async (resolve) => {
474
+ const onClientMismatch = (mismatch) => {
475
+ resolve(mismatch.missing);
476
+ // When the mismatch happens, we ask the messageService to cancel the sending
477
+ return false;
478
+ };
479
+ if (conversationDomain) {
480
+ await this.messageService.sendFederatedMessage(sendingClientId, recipients, text, {
481
+ conversationId: { id: conversationId, domain: conversationDomain },
482
+ onClientMismatch,
483
+ reportMissing: true,
484
+ });
485
+ }
486
+ else {
487
+ await this.messageService.sendMessage(sendingClientId, recipients, text, {
488
+ conversationId,
489
+ onClientMismatch,
490
+ });
491
+ }
492
+ });
493
+ }
460
494
  async deleteMessageLocal(conversationId, messageIdToHide, sendAsProtobuf, conversationDomain) {
461
495
  const messageId = MessageBuilder_1.MessageBuilder.createId();
462
496
  const content = protocol_messaging_1.MessageHide.create({