Skip to content

Commit

Permalink
feat: Show warning when receiving call with outdated client (#8798)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyLnd committed May 14, 2020
1 parent d6d2424 commit 00d3d12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@
"modalCallSecondOutgoingAction": "Call Anyway",
"modalCallSecondOutgoingHeadline": "Hang up current call?",
"modalCallSecondOutgoingMessage": "A call is active in another conversation. Calling here will hang up the other call.",
"modalCallUpdateClientHeadline": "Please update {{brandName}}",
"modalCallUpdateClientMessage": "You received a call that isn't supported by this version of {{brandName}}.",
"modalConfirmSecondary": "Cancel",
"modalConnectAcceptAction": "Connect",
"modalConnectAcceptHeadline": "Accept?",
Expand Down
10 changes: 10 additions & 0 deletions src/script/calling/CallingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
STATE as CALL_STATE,
VIDEO_STATE,
Wcall,
ERROR,
} from '@wireapp/avs';
import {Calling, GenericMessage} from '@wireapp/protocol-messaging';
import {WebAppEvents} from '@wireapp/webapp-events';
Expand Down Expand Up @@ -382,6 +383,15 @@ export class CallingRepository {

if (res !== 0) {
this.logger.warn(`recv_msg failed with code: ${res}`);
if (res === ERROR.UNKNOWN_PROTOCOL) {
const brandName = Config.getConfig().BRAND_NAME;
amplify.publish(WebAppEvents.WARNING.MODAL, ModalsViewModel.TYPE.ACKNOWLEDGE, {
text: {
message: t('modalCallUpdateClientMessage', brandName),
title: t('modalCallUpdateClientHeadline', brandName),
},
});
}
return;
}
this.handleCallEventSaving(content.type, conversationId, userId, time, source);
Expand Down
2 changes: 1 addition & 1 deletion src/script/conversation/ConversationRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,7 @@ export class ConversationRepository {
return this.grantMessage(eventInfoEntity, consentType, userIds);
}

grantMessage(eventInfoEntity, consentType, userIds, shouldShowLegalHoldWarning = false) {
grantMessage(eventInfoEntity, consentType, userIds = null, shouldShowLegalHoldWarning = false) {
return this.get_conversation_by_id(eventInfoEntity.conversationId).then(conversationEntity => {
const legalHoldMessageTypes = [
GENERIC_MESSAGE_TYPE.ASSET,
Expand Down

0 comments on commit 00d3d12

Please sign in to comment.