From 432e3a72b96d4e1d41ea0689b5d9d0276884ca1a Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 24 Jan 2020 15:34:29 +1100 Subject: [PATCH 1/6] hide description field in group panel for now --- stylesheets/_session_group_panel.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/_session_group_panel.scss b/stylesheets/_session_group_panel.scss index 46a58968c..a719c4c18 100644 --- a/stylesheets/_session_group_panel.scss +++ b/stylesheets/_session_group_panel.scss @@ -36,6 +36,7 @@ width: inherit; color: $session-color-white; text-align: center; + display: none; } &-item { From 3f7680ccf7a36d5d9b93437500130acb3345cb63 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jan 2020 10:55:18 +1100 Subject: [PATCH 2/6] fix join publicgroups pulls --- ts/components/session/LeftPaneChannelSection.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ts/components/session/LeftPaneChannelSection.tsx b/ts/components/session/LeftPaneChannelSection.tsx index 9905cde9d..5b4e000a6 100644 --- a/ts/components/session/LeftPaneChannelSection.tsx +++ b/ts/components/session/LeftPaneChannelSection.tsx @@ -392,9 +392,10 @@ export class LeftPaneChannelSection extends React.Component { } private async attemptConnection(serverURL: string, channelId: number) { - const rawserverURL = serverURL + let rawserverURL = serverURL .replace(/^https?:\/\//i, '') .replace(/[/\\]+$/i, ''); + rawserverURL = rawserverURL.toLowerCase(); const sslServerURL = `https://${rawserverURL}`; const conversationId = `publicChat:${channelId}@${rawserverURL}`; @@ -423,12 +424,13 @@ export class LeftPaneChannelSection extends React.Component { 'group' ); - await serverAPI.findOrCreateChannel(channelId, conversationId); await conversation.setPublicSource(sslServerURL, channelId); await conversation.setFriendRequestStatus( window.friends.friendRequestStatusEnum.friends ); + conversation.getPublicSendData(); // may want "await" if you want to use the API + return conversation; } } From 5c4fa1d2cbabfcffe3aa07897aad41598c68614c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jan 2020 13:42:11 +1100 Subject: [PATCH 3/6] increase min height respecting ratio --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 490b3eccb..d82959168 100644 --- a/main.js +++ b/main.js @@ -187,8 +187,8 @@ function captureClicks(window) { const DEFAULT_WIDTH = 800; const DEFAULT_HEIGHT = 710; -const MIN_WIDTH = 640; -const MIN_HEIGHT = 360; +const MIN_WIDTH = 1125; +const MIN_HEIGHT = 750; const BOUNDS_BUFFER = 100; function isVisible(window, bounds) { From c92d22fecef035fcb5f486f32188dc06c94c576a Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jan 2020 15:00:28 +1100 Subject: [PATCH 4/6] allow space inside a display name but not at start or end --- js/modules/loki_app_dot_net_api.js | 2 -- ts/components/session/RegistrationTabs.tsx | 31 +++++++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/js/modules/loki_app_dot_net_api.js b/js/modules/loki_app_dot_net_api.js index 1bd6d6e0f..db017e403 100644 --- a/js/modules/loki_app_dot_net_api.js +++ b/js/modules/loki_app_dot_net_api.js @@ -1351,7 +1351,6 @@ class LokiPublicChannelAPI { // process remaining messages slaveMessages.forEach(messageData => { - const slaveKey = messageData.source; // prevent our own device sent messages from coming back in @@ -1377,7 +1376,6 @@ class LokiPublicChannelAPI { this.chatAPI.emit('publicMessage', { message: messageData, }); - }); // if we received one of our own messages diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index 3f8964a71..8083faf77 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -217,11 +217,11 @@ export class RegistrationTabs extends React.Component<{}, State> { private onDisplayNameChanged(val: string) { const sanitizedName = this.sanitiseNameInput(val); + const trimName = sanitizedName.trim(); + this.setState({ displayName: sanitizedName, - displayNameError: !sanitizedName - ? window.i18n('displayNameEmpty') - : undefined, + displayNameError: !trimName ? window.i18n('displayNameEmpty') : undefined, }); } @@ -553,10 +553,7 @@ export class RegistrationTabs extends React.Component<{}, State> { } private renderTermsConditionAgreement() { - // FIXME - window.log.info( - 'FIXME: add link to our Terms and Conditions and privacy statement' - ); + // FIXME add link to our Terms and Conditions and privacy statement return (
@@ -713,7 +710,7 @@ export class RegistrationTabs extends React.Component<{}, State> { } private sanitiseNameInput(val: string) { - return val.trim().replace(window.displayNameRegex, ''); + return val.replace(window.displayNameRegex, ''); } private async resetRegistration() { @@ -738,6 +735,19 @@ export class RegistrationTabs extends React.Component<{}, State> { passwordFieldsMatch, } = this.state; // Make sure the password is valid + + const trimName = displayName.trim(); + + if (!trimName) { + window.pushToast({ + title: window.i18n('displayNameEmpty'), + type: 'error', + id: 'invalidDisplayName', + }); + + return; + } + if (passwordErrorString) { window.pushToast({ title: window.i18n('invalidPassword'), @@ -761,9 +771,6 @@ export class RegistrationTabs extends React.Component<{}, State> { if (!mnemonicSeed) { return; } - if (!displayName) { - return; - } // Ensure we clear the secondary device registration status window.textsecure.storage.remove('secondaryDeviceStatus'); @@ -775,7 +782,7 @@ export class RegistrationTabs extends React.Component<{}, State> { await this.accountManager.registerSingleDevice( mnemonicSeed, language, - displayName + trimName ); trigger('openInbox'); } catch (e) { From bed1d5ac9d0e8fcdbbda969ad137a583a1905e0e Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jan 2020 15:40:41 +1100 Subject: [PATCH 5/6] fix height of leftpane overlay view --- stylesheets/_session_left_pane.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/_session_left_pane.scss b/stylesheets/_session_left_pane.scss index 2f598ee7f..6116ed801 100644 --- a/stylesheets/_session_left_pane.scss +++ b/stylesheets/_session_left_pane.scss @@ -178,6 +178,7 @@ $session-compose-margin: 20px; display: flex; flex-direction: row; margin: 15px 7px 14px 0px; + height: 33px; @at-root .light-theme #{&} { background-color: $session-color-white; From 191c3b1f54987399555298e6395cca596b34c2e5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jan 2020 15:41:36 +1100 Subject: [PATCH 6/6] add back typing indicator and read receipt setting under privacy --- _locales/en/messages.json | 8 +++++++ .../session/settings/SessionSettings.tsx | 24 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6ebf58fab..a712dc61c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1412,10 +1412,18 @@ "message": "Enable the sending and receiving of read receipts", "description": "Description of the read receipts setting" }, + "readReceiptSettingTitle": { + "message": "Read Receipts", + "description": "Title of the read receipts setting" + }, "typingIndicatorsSettingDescription": { "message": "Enable the sending and receiving of typing indicators", "description": "Description of the typing indicators setting" }, + "typingIndicatorsSettingTitle": { + "message": "Typing Indicators", + "description": "Title of the typing indicators setting" + }, "messageTTL": { "message": "Message TTL", "description": "Title of the Message TTL setting" diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 34a7dfbc1..4e85700cf 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -406,6 +406,30 @@ export class SettingsView extends React.Component { defaultValue: 24, }, }, + { + id: 'read-receipt-setting', + title: window.i18n('readReceiptSettingTitle'), + description: window.i18n('readReceiptSettingDescription'), + hidden: false, + type: SessionSettingType.Toggle, + category: SessionSettingCategory.Privacy, + setFn: undefined, + comparisonValue: undefined, + onClick: undefined, + content: {}, + }, + { + id: 'typing-indicators-setting', + title: window.i18n('typingIndicatorsSettingTitle'), + description: window.i18n('typingIndicatorsSettingDescription'), + hidden: false, + type: SessionSettingType.Toggle, + category: SessionSettingCategory.Privacy, + setFn: undefined, + comparisonValue: undefined, + onClick: undefined, + content: {}, + }, { id: 'set-password', title: window.i18n('setAccountPasswordTitle'),