Merge remote-tracking branch 'upstream/unstable' into standardised_strings

pull/3206/head
Audric Ackermann 8 months ago
commit af28c97cfd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 25 KiB

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.13.0", "version": "1.13.1",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Oxen Labs", "name": "Oxen Labs",
@ -104,7 +104,7 @@
"fs-extra": "9.0.0", "fs-extra": "9.0.0",
"glob": "7.1.2", "glob": "7.1.2",
"image-type": "^4.1.0", "image-type": "^4.1.0",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.21/libsession_util_nodejs-v0.3.21.tar.gz", "libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.22/libsession_util_nodejs-v0.3.22.tar.gz",
"libsodium-wrappers-sumo": "^0.7.9", "libsodium-wrappers-sumo": "^0.7.9",
"linkify-it": "^4.0.1", "linkify-it": "^4.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",

@ -22,10 +22,13 @@ const StyledContent = styled(Flex)`
} }
img:first-child { img:first-child {
filter: brightness(0) saturate(100%) invert(75%) sepia(84%) saturate(3272%) hue-rotate(103deg)
brightness(106%) contrast(103%);
margin: var(--margins-2xl) 0 var(--margins-lg); margin: var(--margins-2xl) 0 var(--margins-lg);
} }
img:nth-child(2) { img:nth-child(2) {
filter: var(--session-logo-text-current-filter);
margin-bottom: var(--margins-xl); margin-bottom: var(--margins-xl);
} }
@ -40,13 +43,14 @@ const StyledContent = styled(Flex)`
export const AboutView = () => { export const AboutView = () => {
// Add debugging metadata - environment if not production, app instance name // Add debugging metadata - environment if not production, app instance name
const states = []; const environmentStates = [];
if (window.getEnvironment() !== 'production') { if (window.getEnvironment() !== 'production') {
states.push(window.getEnvironment()); environmentStates.push(window.getEnvironment());
} }
if (window.getAppInstance()) { if (window.getAppInstance()) {
states.push(window.getAppInstance()); environmentStates.push(window.getAppInstance());
} }
const versionInfo = `v${window.getVersion()}`; const versionInfo = `v${window.getVersion()}`;
@ -63,7 +67,7 @@ export const AboutView = () => {
}, []); }, []);
return ( return (
<SessionTheme> <SessionTheme runSetup={false}>
<SessionToastContainer /> <SessionToastContainer />
<StyledContent <StyledContent
container={true} container={true}
@ -83,7 +87,6 @@ export const AboutView = () => {
width={192} width={192}
height={26} height={26}
/> />
<CopyToClipboardButton <CopyToClipboardButton
className="version" className="version"
text={versionInfo} text={versionInfo}
@ -95,11 +98,13 @@ export const AboutView = () => {
buttonType={SessionButtonType.Simple} buttonType={SessionButtonType.Simple}
/> />
<CopyToClipboardButton className="os" text={osInfo} buttonType={SessionButtonType.Simple} /> <CopyToClipboardButton className="os" text={osInfo} buttonType={SessionButtonType.Simple} />
<CopyToClipboardButton {environmentStates.length ? (
className="environment" <CopyToClipboardButton
text={states.join(' - ')} className="environment"
buttonType={SessionButtonType.Simple} text={environmentStates.join(' - ')}
/> buttonType={SessionButtonType.Simple}
/>
) : null}
<a href="https://getsession.org">https://getsession.org</a> <a href="https://getsession.org">https://getsession.org</a>
<br /> <br />
<a className="privacy" href="https://getsession.org/privacy-policy"> <a className="privacy" href="https://getsession.org/privacy-policy">

@ -5,6 +5,8 @@ import { switchThemeTo } from '../themes/switchTheme';
import { fetchNodeLog } from '../util/logging'; import { fetchNodeLog } from '../util/logging';
import { SessionButton, SessionButtonType } from './basic/SessionButton'; import { SessionButton, SessionButtonType } from './basic/SessionButton';
import { SessionIconButton } from './icon'; import { SessionIconButton } from './icon';
import { CopyToClipboardButton } from './buttons';
import { Flex } from './basic/Flex';
const StyledContent = styled.div` const StyledContent = styled.div`
background-color: var(--modal-background-content-color); background-color: var(--modal-background-content-color);
@ -54,7 +56,14 @@ const DebugLogTextArea = (props: { content: string }) => {
const DebugLogButtons = (props: { content: string }) => { const DebugLogButtons = (props: { content: string }) => {
return ( return (
<div className="buttons"> <Flex
container={true}
width={'fit-content'}
justifyContent={'flex-start'}
alignItems={'center'}
flexGap="var(--margins-md)"
className="buttons"
>
<SessionButton <SessionButton
text={window.i18n('helpReportABugExportLogsSaveToDesktop')} text={window.i18n('helpReportABugExportLogsSaveToDesktop')}
buttonType={SessionButtonType.Simple} buttonType={SessionButtonType.Simple}
@ -66,7 +75,12 @@ const DebugLogButtons = (props: { content: string }) => {
(window as any).saveLog(props.content); (window as any).saveLog(props.content);
}} }}
/> />
</div> <CopyToClipboardButton
copyContent={props.content}
buttonType={SessionButtonType.Simple}
hotkey={true}
/>
</Flex>
); );
}; };
@ -107,7 +121,7 @@ export const DebugLogView = () => {
}, []); }, []);
return ( return (
<SessionTheme> <SessionTheme runSetup={false}>
<StyledContent> <StyledContent>
<div> <div>
<SessionIconButton <SessionIconButton

@ -137,7 +137,8 @@ export const getLatestReleaseFromFileServer = async (
ed25519SecretKey: userEd25519SecretKey, ed25519SecretKey: userEd25519SecretKey,
sigTimestampSeconds, sigTimestampSeconds,
}); });
const body = {
const headers = {
'X-FS-Pubkey': blindedPkHex, 'X-FS-Pubkey': blindedPkHex,
'X-FS-Timestamp': `${sigTimestampSeconds}`, 'X-FS-Timestamp': `${sigTimestampSeconds}`,
'X-FS-Signature': fromUInt8ArrayToBase64(signature), 'X-FS-Signature': fromUInt8ArrayToBase64(signature),
@ -146,7 +147,8 @@ export const getLatestReleaseFromFileServer = async (
abortSignal: new AbortController().signal, abortSignal: new AbortController().signal,
endpoint: RELEASE_VERSION_ENDPOINT, endpoint: RELEASE_VERSION_ENDPOINT,
method: 'GET', method: 'GET',
stringifiedBody: JSON.stringify(body), stringifiedBody: null,
headers,
}); });
if (!batchGlobalIsSuccess(result) || parseStatusCodeFromOnionRequestV4(result) !== 200) { if (!batchGlobalIsSuccess(result) || parseStatusCodeFromOnionRequestV4(result) !== 200) {

@ -502,8 +502,9 @@ async function sendJsonViaOnionV4ToFileServer(sendOptions: {
method: string; method: string;
stringifiedBody: string | null; stringifiedBody: string | null;
abortSignal: AbortSignal; abortSignal: AbortSignal;
headers: Record<string, string | number>;
}): Promise<OnionV4JSONSnodeResponse | null> { }): Promise<OnionV4JSONSnodeResponse | null> {
const { endpoint, method, stringifiedBody, abortSignal } = sendOptions; const { endpoint, method, stringifiedBody, abortSignal, headers } = sendOptions;
if (!endpoint.startsWith('/')) { if (!endpoint.startsWith('/')) {
throw new Error('endpoint needs a leading /'); throw new Error('endpoint needs a leading /');
} }
@ -514,7 +515,7 @@ async function sendJsonViaOnionV4ToFileServer(sendOptions: {
builtUrl, builtUrl,
{ {
method, method,
headers: {}, headers,
body: stringifiedBody, body: stringifiedBody,
useV4: true, useV4: true,
}, },

@ -115,9 +115,8 @@ describe('OnionPaths', () => {
describe('getRandomEdgeSnode', () => { describe('getRandomEdgeSnode', () => {
it('random if multiple matches', () => { it('random if multiple matches', () => {
const originalSnodePool = generateFakeSnodes(5); const originalSnodePool = generateFakeSnodes(5);
const filtered = originalSnodePool.filter((_m, i) => i % 5 !== 0);
const winner = OnionPaths.getRandomEdgeSnode(originalSnodePool); const winner = OnionPaths.getRandomEdgeSnode(originalSnodePool);
expect(filtered).to.deep.include(winner); expect(originalSnodePool).to.deep.include(winner);
}); });
}); });

@ -6,6 +6,7 @@ import { SettingsKey } from '../data/settings-key';
import { getOppositeTheme, isThemeMismatched } from '../util/theme'; import { getOppositeTheme, isThemeMismatched } from '../util/theme';
import { THEME_GLOBALS, setThemeValues } from './globals'; import { THEME_GLOBALS, setThemeValues } from './globals';
import { switchThemeTo } from './switchTheme'; import { switchThemeTo } from './switchTheme';
import { Storage } from '../util/storage';
export async function ensureThemeConsistency(): Promise<boolean> { export async function ensureThemeConsistency(): Promise<boolean> {
const theme = window.Events.getThemeSetting(); const theme = window.Events.getThemeSetting();
@ -52,10 +53,21 @@ const setupTheme = async () => {
} }
}; };
export const SessionTheme = ({ children }: { children: ReactNode }) => { export const SessionTheme = ({
children,
runSetup = true,
}: {
children: ReactNode;
/** If we don't have access to some window object functions we may skip theme consistency checks */
runSetup?: boolean;
}) => {
useMount(() => { useMount(() => {
setThemeValues(THEME_GLOBALS); setThemeValues(THEME_GLOBALS);
void setupTheme(); if (runSetup) {
void Storage.onready(() => {
void setupTheme();
});
}
}); });
return children; return children;
}; };

@ -1786,9 +1786,9 @@ available-typed-arrays@^1.0.7:
possible-typed-array-names "^1.0.0" possible-typed-array-names "^1.0.0"
axios@^1.6.5: axios@^1.6.5:
version "1.7.2" version "1.7.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.4.tgz#4c8ded1b43683c8dd362973c393f3ede24052aa2"
integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== integrity sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==
dependencies: dependencies:
follow-redirects "^1.15.6" follow-redirects "^1.15.6"
form-data "^4.0.0" form-data "^4.0.0"
@ -2664,9 +2664,9 @@ date-fns@^3.6.0:
integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==
debug@4, debug@^4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: debug@4, debug@^4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
version "4.3.5" version "4.3.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b"
integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==
dependencies: dependencies:
ms "2.1.2" ms "2.1.2"
@ -4955,9 +4955,9 @@ levn@~0.3.0:
prelude-ls "~1.1.2" prelude-ls "~1.1.2"
type-check "~0.3.2" type-check "~0.3.2"
"libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.21/libsession_util_nodejs-v0.3.21.tar.gz": "libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.22/libsession_util_nodejs-v0.3.22.tar.gz":
version "0.3.21" version "0.3.22"
resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.21/libsession_util_nodejs-v0.3.21.tar.gz#64705b1f7c934ca32f929ea8127370cc82bab97a" resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.22/libsession_util_nodejs-v0.3.22.tar.gz#6d9246a7469edb6b90edd9b637726419e4a65571"
dependencies: dependencies:
cmake-js "^7.2.1" cmake-js "^7.2.1"
node-addon-api "^6.1.0" node-addon-api "^6.1.0"

Loading…
Cancel
Save