Skip to content

Commit

Permalink
release-3.26 (#5152)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian authored Jun 28, 2021
2 parents f5fcfde + bf32c6d commit d2cb074
Show file tree
Hide file tree
Showing 30 changed files with 2,310 additions and 2,663 deletions.
17 changes: 12 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,31 @@ updates:
schedule:
interval: weekly
day: monday
time: '05:00'
timezone: 'Europe/Berlin'
open-pull-requests-limit: 99
versioning-strategy: increase
ignore:
# our current Electron version uses Node.js 14
- dependency-name: '@types/node'
versions:
- '>= 13.x'
- '> 14.x'
# in progress, always takes some time to follow all breaking changes
- dependency-name: electron
versions:
- '>= 11.x'
- '> 11.x'
- dependency-name: electron-builder
versions:
- '>= 21.x'
- '> 20.x'
# multiple setup problems and 4.x works fine
- dependency-name: husky
versions:
- '>= 5.x'
- '> 4.x'
# when building, we receive this error with winstaller 5.0:
# Error: no such file or directory, copyfile 'vendor/7z-ia32.exe' -> 'vendor/7z.exe'
- dependency-name: electron-winstaller
versions:
- '>= 5.x'
- '> 4.x'
- package-ecosystem: npm
directory: '/app-config'
schedule:
Expand Down
4 changes: 2 additions & 2 deletions app-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"wire-web-config-internal": "https://github.com/wireapp/wire-web-config-default#v0.28.4",
"wire-web-config-production": "https://github.com/wireapp/wire-web-config-wire#v0.28.5-0"
"wire-web-config-internal": "https://github.com/wireapp/wire-web-config-default#v0.28.17",
"wire-web-config-production": "https://github.com/wireapp/wire-web-config-wire#v0.28.18-0"
}
}
10 changes: 5 additions & 5 deletions electron/locale/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@
"menuActualSize": "元のサイズ",
"menuZoomIn": "ズームイン",
"menuZoomOut": "ズームアウト",
"wrapperAddAccountErrorTitlePlural": "{{maximumAccounts}} accounts already active",
"wrapperAddAccountErrorTitleSingular": "Account already active",
"wrapperAddAccountErrorMessagePlural": "You can only be logged in with {{maximumAccounts}} accounts at once. Log out from one to add another.",
"wrapperAddAccountErrorMessageSingular": "You can only be logged in with one account at once. Log out from this one to add another.",
"wrapperAddAccountErrorTitlePlural": "{{maximumAccounts}} アカウントが既にアクティブです",
"wrapperAddAccountErrorTitleSingular": "アカウントはすでにアクティブです。",
"wrapperAddAccountErrorMessagePlural": "1度に{{maximumAccounts}}つのアカウントまでログインできます。新規にログインする為に、1つログアウトしてください。",
"wrapperAddAccountErrorMessageSingular": "1度に1つのアカウントまでログインできます。このアカウントからログアウトして別のアカウントを追加してください。",
"promptOK": "OK",
"promptCancel": "キャンセル",
"promptWarning": "警告",
"promptError": "エラー",
"urlBlockedPromptText": "A potentially unsafe URL has been blocked. If you still wish to open it, copy the URL and open the appropriate application."
"urlBlockedPromptText": "安全でない可能性のあるURLがブロックされました。それでも開きたい場合は、URLをコピーして適切なアプリケーションを開きます。"
}
26 changes: 13 additions & 13 deletions electron/locale/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"certificateVerifyProcManagerWarningBypass": "Ne yaptığımı biliyorum, bunu {brandName} ağında kullanın",
"certificateVerifyProcManagerWarningTextChromium": "{brandName}, {brandName} sunucularına güvenli bağlantıya izin vermeyen bir ağdayken sizi uyarır. Bunun birkaç nedeni olabilir:\n\n• Bağlantıları kesen kurumsal bir güvenlik duvarının arkasındasınız.\n• Bir otel veya havaalanı Wi-Fi gibi halka açık bir Wi-Fi şebekesindesiniz.\n• Saldırganlar bilgilerinizi çalmaya çalışıyor olabilir\n\nBu ağda {brandName} kullanmamalısınız.",
"certificateVerifyProcManagerWarningTextPinning": "{brandName}, {brandName} sunucularına güvenli bağlantıya izin vermeyen bir ağdayken sizi uyarır. Bunun birkaç nedeni olabilir:\n\n• Bağlantıları kesen kurumsal bir güvenlik duvarının arkasındasınız.\n• Bir otel veya havaalanı Wi-Fi gibi halka açık bir Wi-Fi şebekesindesiniz.\n• Saldırganlar bilgilerinizi çalmaya çalışıyor olabilir\n\nNe yaptığınızı bilmiyorsanız, bu ağda {brandName} kullanmamalısınız.",
"certificateVerifyProcManagerWarningTitle": "Bağlantın özel değil",
"certificateVerifyProcManagerWarningTitle": "Bağlantınız özel değil",
"changeEnvironmentModalConfirm": "Bağlan",
"changeEnvironmentModalText": "\"{url}\" sunucusuna bağlanacaksınız.",
"changeEnvironmentModalTitle": "Sunucuya bağlan",
Expand Down Expand Up @@ -67,7 +67,7 @@
"menuVideoCall": "Görüntülü Ara",
"menuView": "Görüntüle",
"menuWindow": "Pencere",
"noInternet": "No Internet",
"noInternet": "İnternet bağlantısı yok",
"proxyPromptHeadline": "Proxy kullanıcı adı ve şifre ile doğrulama gerektirmektedir.",
"proxyPromptPassword": "Şifre",
"proxyPromptTitle": "Proxy Doğrulaması",
Expand All @@ -79,7 +79,7 @@
"trayOpen": "",
"trayQuit": "Çık",
"unreadMessages": "Okunmamış mesaj",
"webviewErrorDescription": "\"{url}\" sunucusuna bağlanılamıyor.",
"webviewErrorDescription": "\"{url}\" adresindeki sunucuya bağlanılamıyor.",
"webviewErrorDescriptionSub": "Sunucu yöneticinize bu sorunu bildirin.",
"webviewErrorRetryAction": "Yeniden Dene",
"webviewErrorTitle": "Sunucuya ulaşılamıyor.",
Expand All @@ -90,16 +90,16 @@
"wrapperRemoveAccount": "Hesabı Kaldır",
"menuEnableSpellChecking": "Yazım Denetimini Etkinleştir",
"menuCopyPicture": "Resmi Kopyala",
"menuActualSize": "Actual Size",
"menuZoomIn": "Zoom In",
"menuZoomOut": "Zoom Out",
"wrapperAddAccountErrorTitlePlural": "{{maximumAccounts}} accounts already active",
"wrapperAddAccountErrorTitleSingular": "Account already active",
"wrapperAddAccountErrorMessagePlural": "You can only be logged in with {{maximumAccounts}} accounts at once. Log out from one to add another.",
"wrapperAddAccountErrorMessageSingular": "You can only be logged in with one account at once. Log out from this one to add another.",
"menuActualSize": "Gerçek Boyut",
"menuZoomIn": "Yakınlaştır",
"menuZoomOut": "Uzaklaştır",
"wrapperAddAccountErrorTitlePlural": "{{maximumAccounts}} hesap zaten aktif",
"wrapperAddAccountErrorTitleSingular": "Hesap zaten aktif",
"wrapperAddAccountErrorMessagePlural": "Sadece {{maximumAccounts}} sefere kadar hesap ekleyebilirsiniz. Bir hesap eklemek için başka bir hesaptan çıkış yapın.",
"wrapperAddAccountErrorMessageSingular": "Sadece 1 sefere kadar hesap ekleyebilirsiniz. Bir hesap eklemek için başka bir hesaptan çıkış yapın.",
"promptOK": "Tamam",
"promptCancel": "İptal",
"promptWarning": "Warning",
"promptError": "Error",
"urlBlockedPromptText": "A potentially unsafe URL has been blocked. If you still wish to open it, copy the URL and open the appropriate application."
"promptWarning": "Dikkat",
"promptError": "Hata",
"urlBlockedPromptText": "Potansiyel tehlikeli bir URL engellendi. Eğer açmak isterseniz, URL'yi kopyalayıp uygun uygulamada açın"
}
15 changes: 12 additions & 3 deletions electron/renderer/src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const ActionType = {
HIDE_CONTEXT_MENUS: 'HIDE_CONTEXT_MENUS',
INITIATE_SSO: 'INITIATE_SSO',
RESET_IDENTITY: 'RESET_IDENTITY',
SET_CONVERSATION_JOIN_DATA: 'SET_CONVERSATION_JOIN_DATA',
SWITCH_ACCOUNT: 'SWITCH_ACCOUNT',
TOGGLE_ADD_ACCOUNT_VISIBILITY: 'TOGGLE_ADD_ACCOUNT_VISIBILITY',
TOGGLE_EDIT_ACCOUNT_VISIBILITY: 'TOGGLE_EDIT_ACCOUNT_VISIBILITY',
Expand Down Expand Up @@ -67,10 +68,18 @@ export const updateAccount = (id, data) => ({
type: ActionType.UPDATE_ACCOUNT,
});

export const updateAccountLifecycle = (id, channel) => ({
data: channel,
export const updateAccountLifecycle = (id, channel) => {
return {
data: channel,
id,
type: ActionType.UPDATE_ACCOUNT_LIFECYCLE,
};
};

export const setConversationJoinData = (id, data) => ({
data,
id,
type: ActionType.UPDATE_ACCOUNT_LIFECYCLE,
type: ActionType.SET_CONVERSATION_JOIN_DATA,
});

export const updateAccountBadge = (id, count) => ({
Expand Down
63 changes: 47 additions & 16 deletions electron/renderer/src/components/Webview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import {WindowUrl} from '../lib/WindowUrl';
import {
abortAccountCreation,
resetIdentity,
setConversationJoinData,
updateAccountBadgeCount,
updateAccountData,
updateAccountLifecycle,
} from '../actions';
import {getText, wrapperLocale} from '../lib/locale';
import {AccountSelector} from '../selector/AccountSelector';

import './Webview.css';
import {accountAction} from '../actions/AccountAction';

Expand All @@ -59,11 +59,14 @@ const getEnvironmentUrl = account => {
};

const Webview = ({
abortAccountCreation,
account,
accountIndex,
accountLifecycle,
conversationJoinData,
onUnreadCountUpdated,
abortAccountCreation,
resetIdentity,
setConversationJoinData,
switchWebview,
updateAccountData,
updateAccountLifecycle,
Expand Down Expand Up @@ -145,10 +148,11 @@ const Webview = ({

useEffect(() => {
const onIpcMessage = ({channel, args}) => {
const accountId = account.id;

switch (channel) {
case EVENT_TYPE.WRAPPER.NAVIGATE_WEBVIEW: {
const [customUrl] = args;
const accountId = account.id;
const updatedWebapp = WindowUrl.createWebAppUrl(window.location, customUrl);
updateAccountData(accountId, {
webappUrl: updatedWebapp,
Expand All @@ -167,9 +171,17 @@ const Webview = ({
break;
}

case EVENT_TYPE.LIFECYCLE.SIGNED_IN:
case EVENT_TYPE.LIFECYCLE.SIGNED_IN: {
if (conversationJoinData) {
window.sendConversationJoinToHost(accountId, conversationJoinData.code, conversationJoinData.key);
setConversationJoinData(accountId, undefined);
}
updateAccountLifecycle(accountId, channel);
break;
}

case EVENT_TYPE.LIFECYCLE.SIGN_OUT: {
updateAccountLifecycle(account.id, channel);
updateAccountLifecycle(accountId, channel);
break;
}

Expand All @@ -178,14 +190,25 @@ const Webview = ({
if (clearData) {
deleteWebview(account);
} else {
resetIdentity(account.id);
resetIdentity(accountId);
}
break;
}

case EVENT_TYPE.ACTION.JOIN_CONVERSATION: {
const [data] = args;
if (accountLifecycle === EVENT_TYPE.LIFECYCLE.SIGNED_IN) {
window.sendConversationJoinToHost(accountId, data.code, data.key);
setConversationJoinData(accountId, undefined);
} else {
setConversationJoinData(accountId, data);
}
break;
}

case EVENT_TYPE.LIFECYCLE.UNREAD_COUNT: {
const [badgeCount] = args;
onUnreadCountUpdated(account.id, badgeCount);
onUnreadCountUpdated(accountId, badgeCount);
break;
}
}
Expand All @@ -197,7 +220,7 @@ const Webview = ({
webviewRef.current.removeEventListener(ON_IPC_MESSAGE, onIpcMessage);
}
};
}, []);
}, [account, accountLifecycle, conversationJoinData]);

const deleteWebview = account => {
window.sendDeleteAccount(account.id, account.sessionID).then(() => {
Expand Down Expand Up @@ -284,11 +307,19 @@ const Webview = ({
);
};

export default connect((state, props) => ({accountIndex: AccountSelector.getAccountIndex(state, props.account.id)}), {
abortAccountCreation,
resetIdentity,
switchWebview: accountAction.switchWebview,
updateAccountBadgeCount,
updateAccountData,
updateAccountLifecycle,
})(Webview);
export default connect(
(state, props) => ({
accountIndex: AccountSelector.getAccountIndex(state, props.account.id),
accountLifecycle: AccountSelector.getAccountLifecycle(state, props.account.id),
conversationJoinData: AccountSelector.getConversationJoinData(state, props.account.id),
}),
{
abortAccountCreation,
resetIdentity,
setConversationJoinData,
switchWebview: accountAction.switchWebview,
updateAccountBadgeCount,
updateAccountData,
updateAccountLifecycle,
},
)(Webview);
7 changes: 7 additions & 0 deletions electron/renderer/src/reducers/accountReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ export default (state = [createAccount()], action) => {
});
}

case ActionType.SET_CONVERSATION_JOIN_DATA: {
return state.map(account => {
const isMatchingAccount = account.id === action.id;
return isMatchingAccount ? {...account, conversationJoinData: action.data} : account;
});
}

default: {
return state;
}
Expand Down
5 changes: 5 additions & 0 deletions electron/renderer/src/selector/AccountSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ export class AccountSelector {
AccountSelector.getAccounts(state).some(account => account.userID === undefined);
static hasReachedLimitOfAccounts = state => AccountSelector.getAccounts(state).length >= CONFIG.maximumAccounts;
static hasCreatedAccount = state => AccountSelector.getAccounts(state).some(account => account.userID !== undefined);
static getAccountById = (state, accountId) =>
AccountSelector.getAccounts(state).find(account => account.id === accountId);
static getAccountLifecycle = (state, accountId) => AccountSelector.getAccountById(state, accountId)?.lifecycle;
static getConversationJoinData = (state, accountId) =>
AccountSelector.getAccountById(state, accountId)?.conversationJoinData;
}
1 change: 1 addition & 0 deletions electron/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare global {
locStrings: i18nStrings;
locStringsDefault: i18nStrings;
sendBadgeCount(count: number, ignoreFlash: boolean): void;
sendConversationJoinToHost(accountId: string, code: string, key: string): void;
sendDeleteAccount(accountId: string, sessionId?: string): Promise<void>;
sendLogoutAccount(accountId: string): Promise<void>;
submitDeepLink(url: string): void;
Expand Down
22 changes: 22 additions & 0 deletions electron/src/lib/CoreProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ import {platform} from '../runtime/EnvironmentUtil';
import {config} from '../settings/config';
import {WindowManager} from '../window/WindowManager';
import {EVENT_TYPE} from './eventType';
import {showErrorDialog} from '../lib/showDialog';
import {shortenText} from './ElectronUtil';

const logger = getLogger(path.basename(__filename));

const CORE_PROTOCOL_PREFIX = `${config.customProtocolName}://`;
const CORE_PROTOCOL_MAX_LENGTH = 1024;
const START_SSO_FLOW = 'start-sso';
const JOIN_CONVERSATION_FLOW = 'conversation-join';

export class CustomProtocolHandler {
public hashLocation = '';
Expand All @@ -45,6 +48,7 @@ export class CustomProtocolHandler {
!url.startsWith(CORE_PROTOCOL_PREFIX) ||
url.length > CORE_PROTOCOL_MAX_LENGTH
) {
showErrorDialog(`Invalid deep link "${shortenText(url || '', CORE_PROTOCOL_MAX_LENGTH)}."`);
logger.info('Invalid deep link, ignoring');
return;
}
Expand All @@ -54,7 +58,11 @@ export class CustomProtocolHandler {
if (route.host === START_SSO_FLOW) {
logger.info('Deep link is a SSO link, triggering SSO login ...');
await this.handleSSOLogin(route);
} else if (route.host === JOIN_CONVERSATION_FLOW) {
logger.info('Deep link is a conversation join link, triggering join ...');
await this.handleJoinConversation(route);
} else {
// handle invalid deep link
logger.info('Triggering hash location change ...');
this.forwardHashLocation(route);
}
Expand Down Expand Up @@ -82,6 +90,20 @@ export class CustomProtocolHandler {
}
}

private async handleJoinConversation(route: URL): Promise<void> {
if (typeof route.pathname === 'string') {
logger.info('Joining conversation ...');
const code = route.searchParams.get('code');
const key = route.searchParams.get('key');

try {
await this.windowManager.sendActionAndFocusWindow(EVENT_TYPE.ACTION.JOIN_CONVERSATION, {code, key});
} catch (error) {
logger.error(`Cannot join conversation: ${error.message}`, error);
}
}
}

private findDeepLink(argv: string[]): string | void {
return argv.find(arg => arg.startsWith(CORE_PROTOCOL_PREFIX));
}
Expand Down
4 changes: 4 additions & 0 deletions electron/src/lib/ElectronUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ export async function executeJavaScriptWithoutResult(snippet: string, target: We
snippet = `${snippet.replace(/;+$/, '')};0`;
await target.executeJavaScript(snippet);
}

export function shortenText(text: string, maxLength: number): string {
return text.length > maxLength ? `${text.substr(0, maxLength - 4)} ...` : text;
}
1 change: 1 addition & 0 deletions electron/src/lib/eventType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const EVENT_TYPE = {
CREATE_SSO_ACCOUNT_RESPONSE: 'EVENT_TYPE.ACTION.CREATE_SSO_ACCOUNT_RESPONSE',
DEEP_LINK_SUBMIT: 'EVENT_TYPE.ACTION.DEEP_LINK_SUBMIT',
GET_OG_DATA: 'EVENT_TYPE.ACTION.GET_OG_DATA',
JOIN_CONVERSATION: 'EVENT_TYPE.ACTION.JOIN_CONVERSATION',
NOTIFICATION_CLICK: 'EVENT_TYPE.ACTION.NOTIFICATION_CLICK',
SAVE_PICTURE: 'EVENT_TYPE.ACTION.SAVE_PICTURE',
SIGN_OUT: 'EVENT_TYPE.ACTION.SIGN_OUT',
Expand Down
Loading

0 comments on commit d2cb074

Please sign in to comment.