Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": {
"@wireapp/antiscroll-2": "1.0.2",
"@wireapp/avs": "8.0.13",
"@wireapp/core": "24.1.1",
"@wireapp/core": "24.2.0",
"@wireapp/react-ui-kit": "7.55.0",
"@wireapp/store-engine-dexie": "1.6.8",
"@wireapp/store-engine-sqleet": "1.7.13",
Expand Down
2 changes: 1 addition & 1 deletion src/script/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class Configuration {
readonly ALLOWED_IMAGE_TYPES = ['image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/png'];

/** Which versions of the backend api do we support */
readonly SUPPORTED_API_VERSIONS = [0];
readonly SUPPORTED_API_VERSIONS = [1, 0];
}

let instance: Configuration;
Expand Down
8 changes: 4 additions & 4 deletions src/script/calling/CallingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,8 @@ export class CallingRepository {
conversationType: CONV_TYPE,
) => {
const conversationId = this.parseQualifiedId(convId);
const conversationEntity = this.conversationState.findConversation(conversationId);
if (!conversationEntity) {
const conversation = this.conversationState.findConversation(conversationId);
if (!conversation) {
return;
}
const storedCall = this.findCall(conversationId);
Expand All @@ -1246,13 +1246,13 @@ export class CallingRepository {
// When a second call arrives in the same conversation, we need to clean that call first
this.removeCall(storedCall);
}
const canRing = !conversationEntity.showNotificationsNothing() && shouldRing && this.isReady;
const canRing = !conversation.showNotificationsNothing() && shouldRing && this.isReady;
const selfParticipant = new Participant(this.selfUser, this.selfClientId);
const isVideoCall = hasVideo ? CALL_TYPE.VIDEO : CALL_TYPE.NORMAL;
const isMuted = Config.getConfig().FEATURE.CONFERENCE_AUTO_MUTE && conversationType === CONV_TYPE.CONFERENCE;
const call = new Call(
this.parseQualifiedId(userId),
conversationId,
conversation.qualifiedId,
conversationType,
selfParticipant,
hasVideo ? CALL_TYPE.VIDEO : CALL_TYPE.NORMAL,
Expand Down
5 changes: 3 additions & 2 deletions src/script/conversation/ClientMismatchUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ type ClientDiff = {
export function extractClientDiff(
{deleted = {}, redundant = {}, missing = {}}: Partial<ClientMismatch> | Partial<MessageSendingStatus>,
users?: User[],
defaultDomain: string = '',
): ClientDiff {
const allDeleted = {...deleted, ...redundant} as QualifiedUserClients | UserClients;
const deletedClients = isQualifiedUserClients(allDeleted)
? flattenQualifiedUserClients(allDeleted)
: flattenUserClients(allDeleted);
: flattenUserClients(allDeleted, defaultDomain);
const missingClients = isQualifiedUserClients(missing)
? flattenQualifiedUserClients(missing)
: flattenUserClients(missing);
: flattenUserClients(missing, defaultDomain);

const toClientDiff = ({userId, data}: {data: string[]; userId: QualifiedId}) => ({clients: data, userId});

Expand Down
12 changes: 10 additions & 2 deletions src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class ConversationRepository {
const {missingClients, deletedClients, emptyUsers, missingUserIds} = extractClientDiff(
mismatch,
conversation?.allUserEntities,
this.core.backendFeatures.federationEndpoints ? userState.self().domain : '',
);

if (conversation && missingUserIds.length) {
Expand Down Expand Up @@ -379,13 +380,20 @@ export class ConversationRepository {
options: Partial<NewConversation> = {},
): Promise<Conversation | undefined> {
const userIds = userEntities.map(user => user.qualifiedId);
const usersPayload = this.core.backendFeatures.federationEndpoints
? {
qualified_users: userIds,
users: [] as string[],
}
: {
users: userIds.map(({id}) => id),
};

let payload: NewConversation & {conversation_role: string} = {
conversation_role: DefaultRole.WIRE_MEMBER,
name: groupName,
qualified_users: this.core.backendFeatures.federationEndpoints ? userIds : undefined,
receipt_mode: null,
users: userIds.map(({id}) => id),
...usersPayload,
...options,
};

Expand Down
8 changes: 4 additions & 4 deletions src/script/conversation/MessageRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,10 @@ export class MessageRepository {
UserRepository.CONFIG.MAXIMUM_TEAM_SIZE_BROADCAST,
);

const recipients = users.reduce<UserClients>((recipientsIndex, userEntity) => {
recipientsIndex[userEntity.id] = userEntity.devices().map(clientEntity => clientEntity.id);
return recipientsIndex;
}, {});
const recipients = this.core.backendFeatures.federationEndpoints
? this.createQualifiedRecipients(users)
: this.createRecipients(users);

this.core.service!.broadcast.broadcastGenericMessage(genericMessage, recipients, false, mismatch => {
this.onClientMismatch?.(mismatch);
});
Expand Down
2 changes: 1 addition & 1 deletion src/script/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class App {
telemetry.timeStep(AppInitTimingsStep.RECEIVED_ACCESS_TOKEN);
const {clientType} = await authRepository.init();
const selfUser = await this.initiateSelfUser();
if (this.apiClient.backendFeatures.federationEndpoints) {
if (this.apiClient.backendFeatures.isFederated) {
// Migrate all existing session to fully qualified ids (if need be)
await migrateToQualifiedSessionIds(
this.repository.storage.storageService.db.sessions,
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2984,16 +2984,16 @@
resolved "https://registry.yarnpkg.com/@wireapp/antiscroll-2/-/antiscroll-2-1.0.2.tgz#71a78d294ee0c88f42d50477ab61fa39272f5bca"
integrity sha512-9KeB3yh9k01PjpuuRQsve4yY3+OVS2/hp9j+N13Is5wYCZRkUzZVCs8w9CyA/C6J5o9ukH0EzT7uurysWuhn/A==

"@wireapp/api-client@18.2.0":
version "18.2.0"
resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-18.2.0.tgz#943dc2092775951b4bf63695a04c92b74cd2dbf1"
integrity sha512-/zAdYX0B7wRaOlhigjCLf262jdzs57o8KAOGNc++ut+DJIRLwqcB4Zt6Ds2eTJvdnJgmhKPiONya+aCzuECUfg==
"@wireapp/api-client@18.3.0":
version "18.3.0"
resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-18.3.0.tgz#c9080c3a195564feee7a6664448b7b0f38c17490"
integrity sha512-qwNOM/4Qr5rq4+zFNp532IliNoa9vvVH9WEPX34C3gHLWrhjKXb0x/+Y4jWqVbAHgwAVKLys15ji+vNVrHPDQw==
dependencies:
"@types/node" "~14"
"@types/spark-md5" "3.0.2"
"@types/tough-cookie" "4.0.1"
"@wireapp/commons" "4.2.13"
"@wireapp/priority-queue" "1.6.38"
"@wireapp/priority-queue" "1.6.39"
"@wireapp/protocol-messaging" "1.37.0"
axios "0.21.4"
axios-retry "3.1.9"
Expand Down Expand Up @@ -3041,14 +3041,14 @@
logdown "3.3.1"
rimraf "3.0.2"

"@wireapp/core@24.1.1":
version "24.1.1"
resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-24.1.1.tgz#01ceba920d65bff0749f6447b4030df7832294ff"
integrity sha512-G5GQhtvp8NWExiIZ4w9PZ7GPXJDAop9Vhmo35Ug/1B97ccjYX//guPyrJ6RXd5mkUK0oMsQDWXbDtWb/m1GjDA==
"@wireapp/core@24.2.0":
version "24.2.0"
resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-24.2.0.tgz#f3bdb90c949d61ea41d20e569ff990f64206dea3"
integrity sha512-vf/FbGFZ0ojL5zGb9VahD2QR7xW7fs5HLh3NlVV+vHvLqH5lIXjGI068V8vz5Cq4GIrTwa13Gfwf97dK7UCDmA==
dependencies:
"@types/long" "4.0.1"
"@types/node" "~14"
"@wireapp/api-client" "18.2.0"
"@wireapp/api-client" "18.3.0"
"@wireapp/cryptobox" "12.7.1"
bazinga64 "5.10.0"
hash.js "1.1.7"
Expand Down Expand Up @@ -3092,10 +3092,10 @@
dependencies:
"@types/node" "~14"

"@wireapp/priority-queue@1.6.38":
version "1.6.38"
resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-1.6.38.tgz#7dfc4667a977e7075ca87f52fc3e7554419738f0"
integrity sha512-WZ6oMoI9wpg0N/kdytXxoVuibyKCQCmlJF2xejacL4O13spRyfQghMYA+4PuKJmSTezk/78TGfKBwnhS3nRa6w==
"@wireapp/priority-queue@1.6.39":
version "1.6.39"
resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-1.6.39.tgz#ebf887bc74ae1331bc9ad3612fcc7dcaf7e47e0c"
integrity sha512-Rsv0DixzhEwETALKEk0BRlQ4w0W2/oNtYpcTxpcCGOLZee9aqag3ETFo2LLnvGjCv14Q95FkGrzpvRT8yo2SVQ==
dependencies:
"@types/node" "~14"

Expand Down