Skip to content

Commit

Permalink
Merge pull request #1454 from wireapp/staging
Browse files Browse the repository at this point in the history
release 2017-06-28
  • Loading branch information
Gregor Herdmann authored Jun 28, 2017
2 parents db6e76d + 7462884 commit efb0b7b
Show file tree
Hide file tree
Showing 50 changed files with 397 additions and 176 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!---
PLEASE NOTE:
If you have a feature request, then file it on: https://github.com/wireapp/wire/issues
--->

## Wire for Web Version
<!--- Can be found in the 3rd line of the source code of the page. -->

## Browser Version
<!--- Can be found on: http://whatsmyuseragent.org/ -->

## Installed Browser Addons
<!--- This helps us to find out if there are compatibility issues with addons -->

## Operating System

## What steps will reproduce the problem?
1.
2.
3.

## What is the expected result?


## What happens instead?

<!--- Please provide any additional information below. Attach a screenshot if
possible. -->
19 changes: 0 additions & 19 deletions .github/issue_template.md

This file was deleted.

Binary file modified app/font/Wire.ttf
Binary file not shown.
10 changes: 7 additions & 3 deletions app/page/template/content/conversation/participants.htm
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
<!-- ko if: state() == 'search' -->
<div class="participants-search">
<div class="participants-search-header">
<user-input class="user-list-light" params="input: user_input, selected: user_selected, placeholder: z.string.people_search_placeholder, close: on_search_close" spellcheck="false"></user-input>
<button class="search-button-open button button-medium button-full" data-bind="enable: user_selected().length > 0, click: on_search_add, l10n_text: z.string.people_confirm_label" data-uie-name="do-create"></button>
<user-input class="participants-search-header-list user-list-light" params="input: user_input, selected: user_selected, placeholder: z.string.people_search_placeholder" spellcheck="false"></user-input>
<div class="participants-search-header-close icon-close icon-button" data-bind="click: on_search_close, l10n_tooltip: z.string.tooltip_search_close" data-uie-name="do-close"></div>
</div >
<div class="participants-search-list-wrapper">
<div class="participants-search-content">
<div class="participants-search-list" data-bind="antiscroll: user_selected">
<!-- ko if: conversation().team_id -->
<div class="participant-search-list-header" data-bind="l10n_text: z.string.search_team_members"></div>
Expand All @@ -75,6 +75,10 @@
<user-list params="user: connected_users, filter: user_input, selected: user_selected, mode: z.components.UserListMode.INFO"></user-list>
</div>
</div>
<button class="participants-search-footer button button-full" data-bind="enable: user_selected().length > 0, click: on_search_add" data-uie-name="do-create">
<span class="icon-people-add participants-search-icon"></span>
<span data-bind="l10n_text: search_action"></span>
</button>
</div>
<!-- /ko -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/page/template/content/preferences-account.htm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="preferences-link text-theme" data-bind="click: click_on_delete_account, l10n_text: z.string.preferences_account_delete" data-uie-name="go-delete-account"></div>
</section>

<!-- ko ifnot: z.util.Environment.electron -->
<!-- ko ifnot: z.util.Environment.desktop -->
<section class="preferences-section">
<div class="preferences-link text-theme" data-bind="click: click_on_logout, l10n_text: z.string.preferences_account_log_out" data-uie-name="do-logout"></div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion app/page/template/content/preferences-options.htm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>
</div>
<div class="preferences-detail preferences-detail-emoji" data-bind="l10n_html: {'id': z.string.preferences_options_emoji_replace_detail, 'substitute': '<span class=\'font-size-xs icon-emoji\'></span>'}"></div>
<!-- ko if: z.util.Environment.electron -->
<!-- ko if: z.util.Environment.desktop -->
<div class="preferences-option preferences-options-multiple">
<div class="preferences-option-icon checkbox text-theme" data-bind="attr: {'data-uie-value': option_previews_send}" data-uie-name="status-preference-previews-send">
<input type="checkbox" id="send-preview-checkbox" data-bind="checked: option_previews_send">
Expand Down
2 changes: 1 addition & 1 deletion app/page/template/list/archive.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="archive" class="left-list left-list-archive" data-bind="with: $root.archive">
<div class="left-list-header">
<span class="label-bold-xs" data-bind="l10n_text: z.string.archive_header"></span>
<span class="left-list-header-close-button button-icon-large icon-close" data-uie-name="do-close-archive" data-bind="click: click_on_close_archive"></span>
<span class="left-list-header-close-button button-icon-large icon-close" data-bind="click: click_on_close_archive, l10n_tooltip: z.string.tooltip_search_close" data-uie-name="do-close-archive"></span>
</div>
<div class="left-list-center">
<ul class="left-list-items" data-bind="antiscroll: should_update_scrollbar, bordered_list: conversations_archived">
Expand Down
4 changes: 2 additions & 2 deletions app/page/template/list/preferences.htm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="preferences" class="left-list left-list-preferences" data-bind="with: $root.preferences">
<div class="left-list-header">
<span class="label-bold-xs" data-bind="l10n_text: z.string.preferences_headline"></span>
<span class="left-list-header-close-button button-icon-large icon-close" data-uie-name="do-close-preferences" data-bind="click: click_on_close_preferences"></span>
<span class="left-list-header-close-button button-icon-large icon-close" data-bind="click: click_on_close_preferences, l10n_tooltip: z.string.tooltip_search_close" data-uie-name="do-close-preferences"></span>
</div>
<div class="left-list-center">
<ul class="left-list-items preferences-list-items">
Expand All @@ -23,7 +23,7 @@
<div class="center-column" data-bind="l10n_text: z.string.preferences_av"></div>
</li>
<!-- /ko -->
<!-- ko ifnot: z.util.Environment.electron -->
<!-- ko ifnot: z.util.Environment.desktop -->
<li class="left-list-item left-list-item-clickable" data-bind="click: click_on_about, css: {'text-theme': selected_about}" data-uie-name="go-about">
<div class="left-column icon-wire"></div>
<div class="center-column" data-bind="l10n_text: z.string.preferences_about"></div>
Expand Down
10 changes: 6 additions & 4 deletions app/page/template/list/start-ui.htm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div id="start-ui" data-bind="with: $root.start_ui">
<div class="left-list-header">
<span class="label-bold-xs" data-bind="text: active_team_name" data-uie-name="status-team-name-search"></span>
<span class="left-list-header-close-button button-icon-large icon-close" data-bind="click: click_on_close, l10n_tooltip: z.string.tooltip_search_close" data-uie-name="do-close"></span>
</div>
<div id="start-ui-header" class="start-ui-header border-theme">
<user-input data-bind="input_hint: {text: group_hint_text, trigger: show_hint}"
class="start-ui-header-user-input"
params="input: search_input, placeholder: z.string.search_placeholder, selected: selected_people, enter: on_submit_search, close: click_on_close"
params="input: search_input, placeholder: z.string.search_placeholder, selected: selected_people, enter: on_submit_search"
data-uie-name="enter-search">
</user-input>
<div class="start-ui-header-actions clear" data-bind="css: {'start-ui-header-actions-visible': selected_people().length > 0}">
Expand All @@ -27,8 +28,8 @@
</div>
</div>

<div class="start-ui-list-wrapper">
<div class="start-ui-list" data-bind="antiscroll: should_update_scrollbar">
<div class="left-list-center start-ui-list-wrapper">
<div class="start-ui-list" data-bind="antiscroll: should_update_scrollbar, bordered_list: active_team">
<!-- ko ifnot: show_spinner() -->

<!-- ko ifnot: show_search_results() -->
Expand Down Expand Up @@ -129,7 +130,8 @@ <h1 class="start-ui-import-headline" data-bind="l10n_text: z.string.people_invit

<!-- ko if: show_invite_people() -->
<div class="start-ui-import" data-bind="click: show_invite_bubble" >
<span id="invite-button" class="label-bold-xs" data-bind="text: invite_button_text" data-bubble="#invite-bubble" data-placement="top"></span>
<span class="icon-invite start-ui-import-icon"></span>
<span id="invite-button" data-bind="l10n_text: z.string.people_invite" data-bubble="#invite-bubble" data-placement="top"></span>
</div>
<!-- /ko -->

Expand Down
8 changes: 4 additions & 4 deletions app/page/template/warning.htm
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@
<div class="warning-bar-message"><span data-bind="l10n_text: {'id': z.string.warning_call_unsupported_incoming, substitute: z.util.escape_html(first_name())}"></span>&nbsp;<a class="warning-bar-link" rel="nofollow noopener noreferrer" target="_blank" data-bind="l10n_href: z.string.url_support_calling, l10n_text: z.string.warning_learn_more"></a></div>
<!-- /ko -->
<!-- ko if: z.util.Environment.browser.chrome -->
<!-- ko if: z.util.Environment.electron -->
<!-- ko if: z.util.Environment.desktop -->
<div class="warning-bar-message">
<span data-bind="l10n_text: z.string.warning_call_issues"></span>&nbsp;
<a class="warning-bar-link" rel="nofollow noopener noreferrer" target="_blank" data-bind="l10n_href: z.string.url_wire_for_web, l10n_text: z.string.wire_for_web"></a>
</div>
<!-- /ko -->
<!-- ko ifnot: z.util.Environment.electron -->
<!-- ko ifnot: z.util.Environment.desktop -->
<div class="warning-bar-message"><span data-bind="l10n_text: z.string.warning_call_upgrade_browser"></span></div>
<!-- /ko -->
<!-- /ko -->
Expand All @@ -112,13 +112,13 @@
</div>
<!-- /ko -->
<!-- ko if: z.util.Environment.browser.chrome -->
<!-- ko if: z.util.Environment.electron -->
<!-- ko if: z.util.Environment.desktop -->
<div class="warning-bar-message">
<span data-bind="l10n_text: z.string.warning_call_issues"></span>&nbsp;
<a class="warning-bar-link" rel="nofollow noopener noreferrer" target="_blank" data-bind="l10n_href: z.string.url_wire_for_web, l10n_text: z.string.wire_for_web"></a>
</div>
<!-- /ko -->
<!-- ko ifnot: z.util.Environment.electron -->
<!-- ko ifnot: z.util.Environment.desktop -->
<div class="warning-bar-message"><span data-bind="l10n_text: z.string.warning_call_upgrade_browser"></span></div>
<!-- /ko -->
<!-- /ko -->
Expand Down
2 changes: 1 addition & 1 deletion app/script/calling/SDPMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ z.calling.SDPMapper = {
sdp_lines.push(sdp_line);

const browser_string = `${z.util.Environment.browser.name} ${z.util.Environment.browser.version}`;
if (z.util.Environment.electron) {
if (z.util.Environment.desktop) {
outline = `a=tool:electron ${z.util.Environment.version()} ${z.util.Environment.version(false)} (${browser_string})`;
} else {
outline = `a=tool:webapp ${z.util.Environment.version(false)} (${browser_string})`;
Expand Down
8 changes: 6 additions & 2 deletions app/script/calling/entities/Flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ z.calling.entities.Flow = class Flow {
this.remote_client_id = undefined;
this.remote_user = this.participant_et.user;
this.remote_user_id = this.remote_user.id;
this.self_user_id = this.call_et.self_user_id;
this.self_user = this.call_et.self_user;
this.self_user_id = this.self_user.id;

// Telemetry
this.telemetry = new z.telemetry.calling.FlowTelemetry(this.id, this.remote_user_id, this.call_et, timings);
Expand Down Expand Up @@ -1048,7 +1049,10 @@ z.calling.entities.Flow = class Flow {
* @returns {boolean} False if we locally needed to switch sides
*/
_solve_colliding_states(force_renegotiation = false) {
if (this.self_user_id < this.remote_user_id || force_renegotiation) {
this.logger.debug(`Solving state collision: Self user ID '${this.self_user_id}', remote user ID '${this.remote_user_id}', force_renegotiation '${force_renegotiation}'`);

const self_user_id_looses = this.self_user_id < this.remote_user_id;
if (self_user_id_looses || force_renegotiation) {
this.logger.warn(`We need to switch SDP state of flow with '${this.remote_user.name()}' to answer.`);

this.restart_negotiation(z.calling.enum.SDP_NEGOTIATION_MODE.STATE_COLLISION, true);
Expand Down
2 changes: 1 addition & 1 deletion app/script/client/ClientRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ z.client.ClientRepository = class ClientRepository {

let device_model = platform.name;

if (z.util.Environment.electron) {
if (z.util.Environment.desktop) {
let identifier;
if (z.util.Environment.os.mac) {
identifier = z.string.wire_macos;
Expand Down
8 changes: 3 additions & 5 deletions app/script/components/userInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ z.components.UserListInputViewModel = class UserListInputViewModel {
this.selected = params.selected || ko.observableArray([]);
this.placeholder = params.placeholder;
this.on_enter = params.enter;
this.on_close = params.close;

this.element = component_info.element;
this.input_element = $(this.element).find('.search-input');
Expand Down Expand Up @@ -66,17 +65,16 @@ z.components.UserListInputViewModel = class UserListInputViewModel {
};

ko.components.register('user-input', {

template: `
<div class="search-outer">
<div class="search-inner-wrap">
<div class="search-inner">
<div class="search-inner"">
<div class="search-icon icon-search"></div>
<!-- ko foreach: selected -->
<span data-bind="text: first_name()"></span>
<!-- /ko -->
<input type="text" style="display:none" /> <!-- prevent chrome from autocomplete -->
<input autocomplete="off" maxlength="128" required spellcheck="false" class="search-input" type="text" data-bind="textInput: input, hasFocus: true, event: {keydown: on_key_press}, enter: on_enter, attr: {placeholder: placeholder}" data-uie-name="enter-users">
<div class="search-close icon-close icon-button" data-bind="click: on_close, l10n_tooltip: z.string.tooltip_search_close" data-uie-name="do-close"></div>
<input autocomplete="off" maxlength="128" required spellcheck="false" class="search-input" type="text" data-bind="textInput: input, hasFocus: true, attr: {placeholder: placeholder}, css: {'search-input-show-placeholder': placeholder}, event: {keydown: on_key_press}, enter: on_enter" data-uie-name="enter-users">
</div>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion app/script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ window.z.config = {
// 15 megabyte image upload limit
MAXIMUM_IMAGE_FILE_SIZE: 15 * 1024 * 1024,

// Maximum characters per message
// Maximum characters per sent message
MAXIMUM_MESSAGE_LENGTH: 8000,

// Maximum characters per received message
// Encryption is approx. +40% of the original payload so let's round it at +50%
MAXIMUM_MESSAGE_LENGTH_RECEIVING: 12000 * 1.5,

// bigger requests will be split in chunks with a maximum size as defined
MAXIMUM_USERS_PER_REQUEST: 200,

Expand Down
8 changes: 4 additions & 4 deletions app/script/conversation/ConversationRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ z.conversation.ConversationRepository = class ConversationRepository {
})
.catch((error) => {
this.logger.error(`Error (${error.label}): ${error.message}`);
error = new Error('Failed to update last read timestamp');
Raygun.send(error, {label: error.label, message: error.message});
const raygun_error = new Error('Failed to update last read timestamp');
Raygun.send(raygun_error, {label: error.label, message: error.message});
});
}
}
Expand Down Expand Up @@ -1603,7 +1603,7 @@ z.conversation.ConversationRepository = class ConversationRepository {
return this._send_and_inject_generic_message(conversation_et, generic_message, false)
.then(() => {
this._track_edit_message(conversation_et, original_message_et);
if (z.util.Environment.electron) {
if (z.util.Environment.desktop) {
return this.send_link_preview(message, conversation_et, generic_message);
}
})
Expand Down Expand Up @@ -1708,7 +1708,7 @@ z.conversation.ConversationRepository = class ConversationRepository {
send_text_with_link_preview(message, conversation_et) {
return this.send_text(message, conversation_et)
.then((generic_message) => {
if (z.util.Environment.electron) {
if (z.util.Environment.desktop) {
return this.send_link_preview(message, conversation_et, generic_message);
}
})
Expand Down
59 changes: 34 additions & 25 deletions app/script/conversation/ConversationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,16 +539,19 @@ z.conversation.ConversationService = class ConversationService {
update_asset_as_uploaded_in_db(primary_key, asset_data) {
return this.storage_service.load(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key)
.then((record) => {
record.data.id = asset_data.id;
record.data.otr_key = asset_data.otr_key;
record.data.sha256 = asset_data.sha256;
record.data.key = asset_data.key;
record.data.token = asset_data.token;
record.data.status = z.assets.AssetTransferState.UPLOADED;
return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record);
})
.then(() => {
this.logger.info('Updated asset message_et (uploaded)', primary_key);
if (record) {
record.data.id = asset_data.id;
record.data.key = asset_data.key;
record.data.otr_key = asset_data.otr_key;
record.data.sha256 = asset_data.sha256;
record.data.status = z.assets.AssetTransferState.UPLOADED;
record.data.token = asset_data.token;

return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record)
.then(() => this.logger.info('Updated asset message_et (uploaded)', primary_key));
}

this.logger.warn('Did not find message to update asset (uploaded)', primary_key);
});
}

Expand All @@ -562,15 +565,18 @@ z.conversation.ConversationService = class ConversationService {
update_asset_preview_in_db(primary_key, asset_data) {
return this.storage_service.load(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key)
.then((record) => {
record.data.preview_id = asset_data.id;
record.data.preview_otr_key = asset_data.otr_key;
record.data.preview_sha256 = asset_data.sha256;
record.data.preview_key = asset_data.key;
record.data.preview_token = asset_data.token;
return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record);
})
.then(() => {
this.logger.info('Updated asset message_et (preview)', primary_key);
if (record) {
record.data.preview_id = asset_data.id;
record.data.preview_key = asset_data.key;
record.data.preview_otr_key = asset_data.otr_key;
record.data.preview_sha256 = asset_data.sha256;
record.data.preview_token = asset_data.token;

return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record)
.then(() => this.logger.info('Updated asset message_et (preview)', primary_key));
}

this.logger.warn('Did not find message to update asset (preview)', primary_key);
});
}

Expand All @@ -584,12 +590,15 @@ z.conversation.ConversationService = class ConversationService {
update_asset_as_failed_in_db(primary_key, reason) {
return this.storage_service.load(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key)
.then((record) => {
record.data.status = z.assets.AssetTransferState.UPLOAD_FAILED;
record.data.reason = reason;
return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record);
})
.then(() => {
this.logger.info('Updated asset message_et (failed)', primary_key);
if (record) {
record.data.reason = reason;
record.data.status = z.assets.AssetTransferState.UPLOAD_FAILED;

return this.storage_service.update(z.storage.StorageService.OBJECT_STORE.EVENTS, primary_key, record)
.then(() => this.logger.info('Updated asset message_et (failed)', primary_key));
}

this.logger.warn('Did not find message to update asset (failed)', primary_key);
});
}

Expand Down
Loading

0 comments on commit efb0b7b

Please sign in to comment.