Merge pull request #744 from Bilb/various-redesign-changes

Various redesign changes
pull/746/head
Maxim Shishmarev 5 years ago committed by GitHub
commit 82e1f53f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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"

@ -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

@ -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) {

@ -36,6 +36,7 @@
width: inherit;
color: $session-color-white;
text-align: center;
display: none;
}
&-item {

@ -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;

@ -392,9 +392,10 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
}
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<Props, State> {
'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;
}
}

@ -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 (
<div className="session-terms-conditions-agreement">
@ -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) {

@ -406,6 +406,30 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
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'),

Loading…
Cancel
Save