@wireapp/core 46.21.1 → 46.21.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EAEpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAG/D,OAAO,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EAEpB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,YAAY,EAIZ,4BAA4B,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAGvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAG/D,OAAO,EAEL,cAAc,EA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O,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,WAAW,CAAC;QAC5B,UAAU,EAAE,WAAW,CAAC;QACxB,cAAc,EAAE,WAAW,EAAE,CAAC;KAC/B,GAAG,OAAO,CAAC,IAAI,CAAC;YA4BH,wBAAwB;YAsBxB,gCAAgC;YAyBhC,4BAA4B;YA0B5B,wBAAwB;YAIxB,yBAAyB;IAKvC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoB3E"}
|
|
@@ -26,7 +26,6 @@ const http_1 = require("@wireapp/api-client/lib/http");
|
|
|
26
26
|
const bazinga64_1 = require("bazinga64");
|
|
27
27
|
const commons_1 = require("@wireapp/commons");
|
|
28
28
|
const protocol_messaging_1 = require("@wireapp/protocol-messaging");
|
|
29
|
-
const ConversationService_types_1 = require("./ConversationService.types");
|
|
30
29
|
const conversation_2 = require("../../conversation/");
|
|
31
30
|
const conversationRejoinQueue_1 = require("../../messagingProtocols/mls/conversationRejoinQueue");
|
|
32
31
|
const CoreCryptoMLSError_1 = require("../../messagingProtocols/mls/MLSService/CoreCryptoMLSError");
|
|
@@ -255,24 +254,7 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
255
254
|
* @param conversationId Id of the conversation to which we want to add users
|
|
256
255
|
*/
|
|
257
256
|
async addUsersToMLSConversation({ qualifiedUsers, groupId, conversationId, }) {
|
|
258
|
-
const
|
|
259
|
-
// Failure object for users that are not MLS capable
|
|
260
|
-
const notMLSCapableUserFailure = {
|
|
261
|
-
reason: ConversationService_types_1.AddUsersFailureReasons.NOT_MLS_CAPABLE,
|
|
262
|
-
users: [],
|
|
263
|
-
};
|
|
264
|
-
// There is no blocker for adding users to a conversation that are not MLS capable
|
|
265
|
-
// We just need to skip them when claiming key packages and add them to the failedToAdd list
|
|
266
|
-
for (const user of qualifiedUsers) {
|
|
267
|
-
const protocols = await this.apiClient.api.user.getUserSupportedProtocols(user);
|
|
268
|
-
if (!protocols.includes(conversation_1.ConversationProtocol.MLS)) {
|
|
269
|
-
notMLSCapableUserIds.push(user.id);
|
|
270
|
-
notMLSCapableUserFailure.users.push(user);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
// We need to claim key packages only for users that are MLS capable
|
|
274
|
-
const mlsCapableUsers = qualifiedUsers.filter(user => !notMLSCapableUserIds.includes(user.id));
|
|
275
|
-
const { keyPackages, failures: keysClaimingFailures } = await this.mlsService.getKeyPackagesPayload(mlsCapableUsers);
|
|
257
|
+
const { keyPackages, failures: keysClaimingFailures } = await this.mlsService.getKeyPackagesPayload(qualifiedUsers);
|
|
276
258
|
const { events, failures } = keyPackages.length > 0
|
|
277
259
|
? await this.mlsService.addUsersToExistingConversation(groupId, keyPackages)
|
|
278
260
|
: { events: [], failures: [] };
|
|
@@ -282,12 +264,7 @@ class ConversationService extends commons_1.TypedEventEmitter {
|
|
|
282
264
|
return {
|
|
283
265
|
events,
|
|
284
266
|
conversation,
|
|
285
|
-
failedToAdd: [
|
|
286
|
-
...keysClaimingFailures,
|
|
287
|
-
...failures,
|
|
288
|
-
// In case we have users that are not MLS capable, we add them to the failedToAdd list
|
|
289
|
-
...(notMLSCapableUserIds.length > 0 ? [notMLSCapableUserFailure] : []),
|
|
290
|
-
],
|
|
267
|
+
failedToAdd: [...keysClaimingFailures, ...failures],
|
|
291
268
|
};
|
|
292
269
|
}
|
|
293
270
|
async removeUsersFromMLSConversation({ groupId, conversationId, qualifiedUserIds, }) {
|
|
@@ -546,10 +546,6 @@ describe('ConversationService', () => {
|
|
|
546
546
|
users: [otherUsersToAdd[1]],
|
|
547
547
|
backends: [otherUsersToAdd[1].domain],
|
|
548
548
|
};
|
|
549
|
-
const mlsFailure = {
|
|
550
|
-
reason: __1.AddUsersFailureReasons.NOT_MLS_CAPABLE,
|
|
551
|
-
users: [otherUsersToAdd[2]],
|
|
552
|
-
};
|
|
553
549
|
jest.spyOn(apiClient.api.user, 'getUserSupportedProtocols').mockImplementation(id => {
|
|
554
550
|
if (id === otherUsersToAdd[2]) {
|
|
555
551
|
return Promise.resolve([conversation_1.ConversationProtocol.PROTEUS]);
|
|
@@ -573,7 +569,7 @@ describe('ConversationService', () => {
|
|
|
573
569
|
groupId: mockGroupId,
|
|
574
570
|
conversationId: mockConversationId,
|
|
575
571
|
});
|
|
576
|
-
expect(failedToAdd).toEqual([keysClaimingFailure, addUsersFailure
|
|
572
|
+
expect(failedToAdd).toEqual([keysClaimingFailure, addUsersFailure]);
|
|
577
573
|
});
|
|
578
574
|
});
|
|
579
575
|
describe('tryEstablishingMLSGroup', () => {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^27.39.
|
|
14
|
+
"@wireapp/api-client": "^27.39.1",
|
|
15
15
|
"@wireapp/commons": "^5.4.2",
|
|
16
16
|
"@wireapp/core-crypto": "3.1.0",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.21.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.21.3",
|
|
65
|
+
"gitHead": "95132f3d28f1580a63af83354e448e1d194bc3db"
|
|
66
66
|
}
|