Merge remote-tracking branch 'yougotwill/userconfig_disappearingmessage' into closed-group-chunk2

pull/2963/head
Audric Ackermann 1 year ago
commit 4357f5cc1f

@ -191,7 +191,7 @@
"confirm": "Confirm",
"followSetting": "Follow Setting",
"followSettingDisabled": "Messages you send will no longer disappear. Are you sure you want to turn off disappearing messages?",
"followSettingTimeAndType": "Set your messages to disappear $time$ after they have been $type$?",
"followSettingTimeAndType": "Set your messages to disappear <b>$time$</b> after they have been <b>$type$</b>?",
"youChangedTheTimer": "<b>You</b> have set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>",
"youChangedTheTimerLegacy": "<b>You</b> set the disappearing message timer to <b>$time$</b>",
"theyChangedTheTimer": "<b>$name$</b> has set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>",

@ -78,7 +78,7 @@ function useFollowSettingsButtonClick(
props.timespanSeconds ?? undefined
);
},
showExitIcon: true,
showExitIcon: false,
onClickClose: onExit,
})
);

@ -1,6 +1,7 @@
import { shell } from 'electron';
import { Dispatch } from '@reduxjs/toolkit';
import { shell } from 'electron';
import React, { useState } from 'react';
import styled from 'styled-components';
import { MessageInteraction } from '../../interactions';
import { updateConfirmModal } from '../../state/ducks/modalDialog';
import { SessionWrapperModal } from '../SessionWrapperModal';
@ -10,6 +11,15 @@ import { SessionSpinner } from '../basic/SessionSpinner';
import { SpacerLG } from '../basic/Text';
import { SessionIcon, SessionIconSize, SessionIconType } from '../icon';
const StyledSubText = styled(SessionHtmlRenderer)<{ textLength: number }>`
font-size: var(--font-size-md);
line-height: 1.5;
max-width: ${props =>
props.textLength > 90
? '60ch'
: '33ch'}; // this is ugly, but we want the dialog description to have multiple lines when a short text is displayed
`;
export interface SessionConfirmDialogProps {
message?: string;
messageSub?: string;
@ -64,8 +74,6 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {
const cancelText = props.cancelText || window.i18n('cancel');
const showHeader = !!props.title;
const messageSubText = messageSub ? 'session-confirm-main-message' : undefined;
const onClickOkHandler = async () => {
if (onClickOk) {
setIsLoading(true);
@ -101,7 +109,6 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {
window.inboxStore?.dispatch(updateConfirmModal(null));
};
return (
<SessionWrapperModal
title={title}
@ -119,7 +126,7 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {
</>
)}
<SessionHtmlRenderer tag="span" className={messageSubText} html={message} />
<StyledSubText tag="span" textLength={message.length} html={message} />
<SessionHtmlRenderer tag="span" className="session-confirm-sub-message" html={messageSub} />
<SessionSpinner loading={isLoading} />

@ -757,6 +757,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
* Also returns the uploaded ids to include in the message post so that those attachments are linked to that message.
*/
public async uploadData() {
const start = Date.now();
const finalAttachments = await Promise.all(
(this.get('attachments') || []).map(loadAttachmentData)
);
@ -816,7 +817,10 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
attachments[0].flags = SignalService.AttachmentPointer.Flags.VOICE_MESSAGE;
}
window.log.info(`Upload of message data for message ${this.idForLogging()} is finished.`);
window.log.info(
`Upload of message data for message ${this.idForLogging()} is finished in ${Date.now() -
start}ms.`
);
return {
body,
attachments,

@ -5,7 +5,9 @@ import {
parseBatchGlobalStatusCode,
} from '../open_group_api/sogsv3/sogsV3BatchPoll';
export const fileServerURL = 'http://filev2.getsession.org';
export const fileServerHost = 'filev2.getsession.org';
export const fileServerURL = `http://${fileServerHost}`;
export const fileServerPubKey = 'da21e1d886c6fbaea313f75298bd64aab03a97ce985b46bb2dad9f2089c8ee59';
const RELEASE_VERSION_ENDPOINT = '/session_version?platform=desktop';

@ -1,5 +1,6 @@
import https from 'https';
// eslint-disable import/no-named-default
// eslint-disable-next-line import/no-named-default
import { AbortSignal } from 'abort-controller';
import ByteBuffer from 'bytebuffer';
import { to_string } from 'libsodium-wrappers-sumo';
@ -19,6 +20,7 @@ import { toHex } from '../../utils/String';
import { Snode } from '../../../data/data';
import { callUtilsWorker } from '../../../webworker/workers/browser/util_worker_interface';
import { encodeV4Request } from '../../onions/onionv4';
import { fileServerHost } from '../file_server_api/FileServerApi';
import { hrefPnServerProd } from '../push_notification_api/PnServer';
import { ERROR_CODE_NO_CONNECT } from './SNodeAPI';
@ -854,6 +856,7 @@ async function sendOnionRequestHandlingSnodeEject({
response = result.response;
if (
!isEmpty(finalRelayOptions) &&
finalRelayOptions.host !== fileServerHost &&
response.status === 502 &&
response.statusText === 'Bad Gateway'
) {
@ -863,6 +866,7 @@ async function sendOnionRequestHandlingSnodeEject({
decodingSymmetricKey = result.decodingSymmetricKey;
} catch (e) {
window?.log?.warn('sendOnionRequestNoRetries error message: ', e.message);
if (e.code === 'ENETUNREACH' || e.message === 'ENETUNREACH' || throwErrors) {
throw e;
}

@ -13,12 +13,12 @@ import {
} from '../apis/open_group_api/sogsv3/sogsV3SendMessage';
import { pnServerPubkeyHex, pnServerUrl } from '../apis/push_notification_api/PnServer';
import {
buildErrorMessageWithFailedCode,
FinalDestNonSnodeOptions,
FinalRelayOptions,
Onions,
SnodeResponse,
STATUS_NO_STATUS,
SnodeResponse,
buildErrorMessageWithFailedCode,
} from '../apis/snode_api/onions';
import { PROTOCOLS } from '../constants';
import { OnionV4 } from './onionv4';
@ -239,13 +239,13 @@ const sendViaOnionV4ToNonSnodeWithRetries = async (
minTimeout: OnionSending.getMinTimeoutForSogs(),
onFailedAttempt: e => {
window?.log?.warn(
`sendViaOnionV4ToNonSnodeRetryable attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left...: ${e.message}`
`sendViaOnionV4ToNonSnodeWithRetries attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left...: ${e.message}`
);
},
}
);
} catch (e) {
window?.log?.warn('sendViaOnionV4ToNonSnodeRetryable failed ', e.message, throwErrors);
window?.log?.warn('sendViaOnionV4ToNonSnodeWithRetries failed ', e.message, throwErrors);
if (throwErrors) {
throw e;
}

@ -141,7 +141,7 @@ export const THEME_GLOBALS: ThemeGlobals = {
'--button-path-connecting-color': COLORS.PATH.CONNECTING,
'--button-path-error-color': COLORS.PATH.ERROR,
'--modal-background-color': `rgba(${hexColorToRGB(COLORS.BLACK)}, 0.3)`,
'--modal-background-color': `rgba(${hexColorToRGB(COLORS.BLACK)}, 0.6)`,
'--modal-drop-shadow': `0px 0px 10px rgba(${hexColorToRGB(COLORS.BLACK)}, 0.22)`,
'--lightbox-background-color': `rgba(${hexColorToRGB(COLORS.BLACK)}, 0.8)`,

Loading…
Cancel
Save