Merge pull request #2730 from oxen-io/clearnet

Session 1.10.8
pull/2852/head
Audric Ackermann 2 years ago committed by GitHub
commit e2d3767bf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,47 +3,38 @@
## Advice for new contributors
Start small. The PRs most likely to be merged are the ones that make small,
easily reviewed changes with clear and specific intentions. See below for more
easily reviewed changes with clear and specific intentions.
[guidelines on pull requests](#pull-requests).
It's a good idea to gauge interest in your intended work by finding the current issue
for it or creating a new one yourself. You can use also that issue as a place to signal
for it or creating a new one yourself. Use Github issues as a place to signal
your intentions and get feedback from the users most likely to appreciate your changes.
If you intend to make a pull request for a new feature and the feature is user facing,
please let us know in a new, or existing issue, so we can guide your efforts around
UX/UI considerations.
You're most likely to have your pull request accepted easily if it addresses bugs already
in the [Next Steps project](https://github.com/oxen-io/session-desktop/projects/1),
especially if they are near the top of the Backlog column. Those are what we'll be looking
at next, so it would be great if you helped us out!
You're most likely to have your pull request accepted if it addresses an existing Github issue marked with the [good-first-issue](https://github.com/oxen-io/session-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) tag, these issues are specifically tagged, because they are generally features/bug fixes which can be cleanly merged on a single platform without requiring cross platform work, are generally of lower complexity than larger features and are non contentious, meaning that the core team doesn't need to try and assess the community desire for such a feature before merging.
Once you've spent a little bit of time planning your solution, it's a good idea to go
back to the issue and talk about your approach. We'd be happy to provide feedback. [An
ounce of prevention, as they say!](https://www.goodreads.com/quotes/247269-an-ounce-of-prevention-is-worth-a-pound-of-cure)
Of course we encourage community developers to work on ANY issue filed on our Github regardless of how its tagged, however if you pick up or create an issue without the “Good first issue” tag it would be best if you leave a comment on the issue so that the core team can give you any guidance required, especially around UI heavy features or issues which require cross platform integration.
## Developer Setup
First, you'll need [Node.js](https://nodejs.org/) which matches our current version.
You can check [`.nvmrc` in the `clearnet` branch](https://github.com/oxen-io/session-desktop/blob/clearnet/.nvmrc) to see what the current version is. If you have [nvm](https://github.com/creationix/nvm)
you can just run `nvm use` in the project directory and it will switch to the project's
desired Node.js version. [nvm for windows](https://github.com/coreybutler/nvm-windows) is
still useful, but it doesn't support `.nvmrc` files.
desired Node.js version.
If you are using Windows [nvm for windows](https://github.com/coreybutler/nvm-windows) is
still useful, but it doesn't support `.nvmrc` files. In this case you will need to `nvm install` the projects node version and `nvm use` the installed version
Then you need `git`, if you don't have that yet: https://git-scm.com/
## Platform Specific Instructions
### macOS
1. Install the [Xcode Command-Line Tools](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/).
### Windows
1. **Windows 7 only:**
- Install Microsoft .NET Framework 4.5.1:
https://www.microsoft.com/en-us/download/details.aspx?id=40773
- Install Windows SDK version 8.1: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
1. Install _Windows Build Tools_: Open the [Command Prompt (`cmd.exe`) as Administrator](<https://technet.microsoft.com/en-us/library/cc947813(v=ws.10).aspx>)
and run: `npm install --vs2015 --global --production --add-python-to-path windows-build-tools`
Building on Windows versions 8+ is supported out of the box
### Linux
@ -54,6 +45,12 @@ Then you need `git`, if you don't have that yet: https://git-scm.com/
1. Install `make`
1. Depending on your distro, you might need to install `hunspell` and `hunspell-<lan>` (e.g. `hunspell-en-au`)
If you are using a Debian based Linux distribution gcc, g++ and make can be installed as part of the `build-essential` package using
```
apt install build-essential
```
### All platforms
Now, run these commands in your preferred terminal in a good directory for development:
@ -102,7 +99,7 @@ For example, running:
NODE_APP_INSTANCE=alice yarn start-prod
```
Will run the development environment with the `alice` instance and thus create a seperate storage profile.
Will run the development environment with the `alice` instance and thus create a separate storage profile.
If a fixed profile is needed (in the case of tests), you can specify it using `storageProfile` in the config file. If the change is local then put it in `local-{instance}.json` otherwise put it in `default-{instance}.json` or `{env}-{instance}.json`.
@ -136,25 +133,20 @@ The easiest way to run all tests at once is `yarn test`.
So you wanna make a pull request? Please observe the following guidelines.
<!-- TODO:
* Please do not submit pull requests for translation fixes. Anyone can update
the translations in
[Transifex](https://www.transifex.com/projects/p/signal-desktop).
-->
- First, make sure that your `yarn ready` run passes - it's very similar to what our
Continuous Integration servers do to test the app.
- Never use plain strings right in the source code - pull them from `messages.json`!
You **only** need to modify the default locale
[`_locales/en/messages.json`](_locales/en/messages.json).
<!-- TODO:
Other locales are generated automatically based on that file and then periodically
uploaded to Transifex for translation. -->
uploaded to Crowdin for translation.
- Please do not submit pull requests for pure translation fixes. Anyone can update
the translations at [Crowdin](https://crowdin.com/project/session-desktop).
- [Rebase](https://nathanleclaire.com/blog/2014/09/14/dont-be-scared-of-git-rebase/) your
changes on the latest `development` branch, resolving any conflicts.
changes on the latest `clearnet` branch, resolving any conflicts.
This ensures that your changes will merge cleanly when you open your PR.
- Be sure to add and run tests!
- Make sure the diff between our master and your branch contains only the
- Make sure the diff between `clearnet` and your branch contains only the
minimal set of changes needed to implement your feature or bugfix. This will
make it easier for the person reviewing your code to approve the changes.
Please do not submit a PR with commented out code or unfinished features.
@ -174,7 +166,6 @@ So you wanna make a pull request? Please observe the following guidelines.
choices that may be helpful to someone reviewing or auditing the commit
history in the future. When in doubt, err on the side of a longer
commit message.
Above all, spend some time with the repository. Follow the pull request template added to
your pull request description automatically. Take a look at recent approved pull requests,
see how they did things.

@ -1,5 +1,7 @@
# Building
This document alongside [Releasing.md](RELEASING.md) primarily cover our internal build process for release builds, if you are an external contributor please refer to [Contributing.md](CONTRIBUTING.md) for building instructions.
## Automated
Automatic building of session binaries is done using github actions. Windows and linux binaries will build right out of the box but there are some extra steps needed for Mac OS
@ -65,7 +67,7 @@ git lfs install
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
@ -115,7 +117,7 @@ git lfs install # once git lfs is installed, you have to run this command too
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependecies of this project
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```

@ -8,12 +8,11 @@ Session integrates directly with [Oxen Service Nodes](https://docs.oxen.io/about
## Want to Contribute? Found a Bug or Have a feature request?
Please search for any [existing issues](https://github.com/oxen-io/session-desktop/issues) that describe your bugs in order to avoid duplicate submissions. <br><br>Submissions can be made by making a pull request to our development branch. If you don't know where to start contributing, try reading the Github issues page for ideas.
Please search for any [existing issues](https://github.com/oxen-io/session-desktop/issues) that describe your bug in order to avoid duplicate submissions. <br><br>Submissions can be made by making a pull request to our development branch.If you don't know where to start contributing please read [Contributing.md](CONTRIBUTING.md) and refer to issues tagged with the [Good-first-issue](https://github.com/oxen-io/session-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) tag.
## Build instruction
Build instructions can be found in [BUILDING.md](BUILDING.md).
Build instructions can be found in [Contributing.md](CONTRIBUTING.md).
## Verifying signatures
@ -55,5 +54,5 @@ Please visit https://deb.oxen.io/<br/>
Copyright 2011 Whisper Systems<br/>
Copyright 2013-2017 Open Whisper Systems<br/>
Copyright 2019-2021 The Oxen Project<br/>
Copyright 2019-2023 The Oxen Project<br/>
Licensed under the GPLv3: https://www.gnu.org/licenses/gpl-3.0.html<br/>

@ -31,7 +31,7 @@
"openGroupInvitation": "Community invitation",
"joinOpenGroupAfterInvitationConfirmationTitle": "Join $roomName$?",
"joinOpenGroupAfterInvitationConfirmationDesc": "Are you sure you want to join the $roomName$ community?",
"couldntFindServerMatching": "Couldn't find the corresponding opengroup server",
"couldntFindServerMatching": "Couldn't find the corresponding Community server",
"enterSessionIDOrONSName": "Enter Session ID or ONS name",
"startNewConversationBy...": "Start a new conversation by entering someone's Session ID or share your Session ID with them.",
"loading": "Loading...",

@ -2,7 +2,7 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.10.7",
"version": "1.10.8",
"license": "GPL-3.0",
"author": {
"name": "Oxen Labs",

@ -247,11 +247,12 @@ window.clipboard = clipboard;
window.getSeedNodeList = () =>
window.sessionFeatureFlags.useTestNet
? ['http://public.loki.foundation:38157']
? ['http://seed2.getsession.org:38157']
: [
'https://storage.seed1.loki.network:4433/',
'https://storage.seed3.loki.network:4433/',
'https://public.loki.foundation:4433/',
// Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one
'https://seed1.getsession.org:4443/',
'https://seed2.getsession.org:4443/',
'https://seed3.getsession.org:4443/',
];
const { locale: localFromEnv } = config;

@ -32,7 +32,7 @@ import { ExpirationTimerOptions } from '../util/expiringMessages';
import moment from 'moment';
import styled from 'styled-components';
// Default to the locale from env. It will be overriden if moment
// Default to the locale from env. It will be overridden if moment
// does not recognize it with what moment knows which is the closest.
// i.e. es-419 will return 'es'.
// We just need to use what we got from moment in getLocale on the updateLocale below

@ -17,7 +17,7 @@ const sha512FromPubkey = async (pubkey: string): Promise<string> => {
.join('');
};
// do not do this on every avatar, just cache the values so we can reuse them accross the app
// do not do this on every avatar, just cache the values so we can reuse them across the app
// key is the pubkey, value is the hash
const cachedHashes = new Map<string, number>();

@ -3,7 +3,7 @@ import { SessionIcon, SessionIconType } from '../icon';
import { SessionDropdownItem, SessionDropDownItemType } from './SessionDropdownItem';
// THIS IS DROPDOWN ACCORDIAN STYLE OPTIONS SELECTOR ELEMENT, NOT A CONTEXTMENU
// THIS IS DROPDOWN ACCORDION STYLE OPTIONS SELECTOR ELEMENT, NOT A CONTEXTMENU
type Props = {
label: string;

@ -92,7 +92,7 @@ export const SessionInput = (props: Props) => {
data-testid={inputDataTestId}
onChange={updateInputValue}
className={classNames(enableShowHide ? 'session-input-floating-label-show-hide' : '')}
// just incase onChange isn't triggered
// just in case onChange isn't triggered
onBlur={updateInputValue}
onKeyPress={event => {
if (event.key === 'Enter' && props.onEnterPressed) {

@ -707,7 +707,7 @@ class CompositionBoxInner extends React.Component<Props, State> {
// than the message was sent without the link preview.
// So be sure to reset the staged link preview so it is not sent with the next message.
// if we were not aborted, it's probably just an error on the fetch. Nothing to do excpet mark the fetch as done (with errors)
// if we were not aborted, it's probably just an error on the fetch. Nothing to do except mark the fetch as done (with errors)
if (aborted) {
this.setState({

@ -12,7 +12,7 @@ export const MINIMUM_LINK_PREVIEW_IMAGE_WIDTH = THUMBNAIL_SIDE;
type Props = {
messageId: string;
isDetailView?: boolean; // when the detail is shown for a message, we disble click and some other stuff
isDetailView?: boolean; // when the detail is shown for a message, we disable click and some other stuff
};
export const Message = (props: Props) => {

@ -1,4 +1,4 @@
import React, { ChangeEvent } from 'react';
import React, { ChangeEvent, MouseEvent } from 'react';
import { QRCode } from 'react-qr-svg';
import { Avatar, AvatarSize } from '../avatar/Avatar';
@ -21,29 +21,45 @@ import { sanitizeSessionUsername } from '../../session/utils/String';
import { setLastProfileUpdateTimestamp } from '../../util/storage';
import { ConversationTypeEnum } from '../../models/conversationAttributes';
import { MAX_USERNAME_BYTES } from '../../session/constants';
import styled from 'styled-components';
import { saveQRCode } from '../../util/saveQRCode';
interface State {
profileName: string;
updatedProfileName: string;
oldAvatarPath: string;
newAvatarObjectUrl: string | null;
mode: 'default' | 'edit' | 'qr';
loading: boolean;
}
const handleSaveQRCode = (event: MouseEvent) => {
event.preventDefault();
saveQRCode('session-id', '220px', '220px', 'var(--white-color)', 'var(--black-color)');
};
const StyledQRView = styled.div`
cursor: pointer;
`;
const QRView = ({ sessionID }: { sessionID: string }) => {
return (
<div className="qr-image">
<StyledQRView
aria-label={window.i18n('clickToTrustContact')}
title={window.i18n('clickToTrustContact')}
className="qr-image"
onClick={handleSaveQRCode}
>
<QRCode
value={sessionID}
bgColor="var(--white-color)"
fgColor="var(--black-color)"
level="L"
/>
</div>
</StyledQRView>
);
};
interface State {
profileName: string;
updatedProfileName: string;
oldAvatarPath: string;
newAvatarObjectUrl: string | null;
mode: 'default' | 'edit' | 'qr';
loading: boolean;
}
export class EditProfileDialog extends React.Component<{}, State> {
private readonly convo: ConversationModel;

@ -121,7 +121,7 @@ const OnionPathModalInner = () => {
{nodes.map((snode: Snode | any) => {
let labelText = snode.label
? snode.label
: `${countryLookup.byIso(ip2country(snode.ip))?.country}`;
: countryLookup.byIso(ip2country(snode.ip))?.country;
if (!labelText) {
labelText = window.i18n('unknownCountry');
}

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { MouseEvent, useEffect, useState } from 'react';
import { ToastUtils } from '../../session/utils';
import { matchesHash } from '../../util/passwordUtils';
@ -12,6 +12,7 @@ import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/S
import { SessionWrapperModal } from '../SessionWrapperModal';
import { getCurrentRecoveryPhrase } from '../../util/storage';
import styled from 'styled-components';
import { saveQRCode } from '../../util/saveQRCode';
interface PasswordProps {
setPasswordValid: (val: boolean) => any;
@ -90,15 +91,25 @@ interface SeedProps {
onClickCopy?: () => any;
}
const StyledRecoveryPhrase = styled.i`
margin-bottom: var(--margins-md);
`;
const StyledRecoveryPhrase = styled.i``;
const StyledQRImage = styled.div`
width: fit-content;
margin: 0 auto;
margin: 0 auto var(--margins-lg);
cursor: pointer;
`;
const handleSaveQRCode = (event: MouseEvent) => {
event.preventDefault();
saveQRCode(
'session-recovery-phrase',
'220px',
'220px',
'var(--white-color)',
'var(--black-color)'
);
};
const Seed = (props: SeedProps) => {
const { recoveryPhrase, onClickCopy } = props;
const i18n = window.i18n;
@ -132,6 +143,15 @@ const Seed = (props: SeedProps) => {
{i18n('recoveryPhraseSavePromptMain')}
</p>
<StyledQRImage
aria-label={window.i18n('clickToTrustContact')}
title={window.i18n('clickToTrustContact')}
className="qr-image"
onClick={handleSaveQRCode}
>
<QRCode value={hexEncodedSeed} bgColor={bgColor} fgColor={fgColor} level="L" />
</StyledQRImage>
<StyledRecoveryPhrase
data-testid="recovery-phrase-seed-modal"
className="session-modal__text-highlight"
@ -139,9 +159,6 @@ const Seed = (props: SeedProps) => {
{recoveryPhrase}
</StyledRecoveryPhrase>
</div>
<StyledQRImage className="qr-image">
<QRCode value={hexEncodedSeed} bgColor={bgColor} fgColor={fgColor} level="L" />
</StyledQRImage>
<div
className="session-modal__button-group"
style={{ justifyContent: 'center', width: '100%' }}

@ -173,7 +173,9 @@ export const ConversationListItemHeaderItem = () => {
) : null;
unreadCountDiv = (
<p className="module-conversation-list-item__unread-count">
{unreadCount > CONVERSATION.MAX_UNREAD_COUNT ? `${CONVERSATION.MAX_UNREAD_COUNT}+` : unreadCount}
{unreadCount > CONVERSATION.MAX_UNREAD_COUNT
? `${CONVERSATION.MAX_UNREAD_COUNT}+`
: unreadCount}
</p>
);
}

@ -22,7 +22,7 @@ const StyledConversationTitleResults = styled.div`
white-space: nowrap;
text-overflow: ellipsis;
color: var(--conversation-tab-text-color);
/* We don't want this to overflow horziontally past the timestamp */
/* We don't want this to overflow horizontally past the timestamp */
width: 90px;
`;

@ -12,19 +12,25 @@ import { TypingBubble } from '../../conversation/TypingBubble';
import { SessionSettingButtonItem, SessionToggleWithDescription } from '../SessionSettingListItem';
import { displayPasswordModal } from '../SessionSettings';
async function toggleLinkPreviews() {
const newValue = !window.getSettingValue(SettingsKey.settingsLinkPreview);
await window.setSettingValue(SettingsKey.settingsLinkPreview, newValue);
if (!newValue) {
await Data.createOrUpdateItem({ id: hasLinkPreviewPopupBeenDisplayed, value: false });
} else {
async function toggleLinkPreviews(forceUpdate: () => void) {
const isToggleOn = Boolean(window.getSettingValue(SettingsKey.settingsLinkPreview));
if (!isToggleOn) {
window.inboxStore?.dispatch(
updateConfirmModal({
title: window.i18n('linkPreviewsTitle'),
message: window.i18n('linkPreviewsConfirmMessage'),
okTheme: SessionButtonColor.Danger,
onClickOk: async () => {
const newValue = !isToggleOn;
await window.setSettingValue(SettingsKey.settingsLinkPreview, newValue);
forceUpdate();
},
})
);
} else {
await window.setSettingValue(SettingsKey.settingsLinkPreview, false);
await Data.createOrUpdateItem({ id: hasLinkPreviewPopupBeenDisplayed, value: false });
forceUpdate();
}
}
@ -70,8 +76,7 @@ export const SettingsCategoryPrivacy = (props: {
/>
<SessionToggleWithDescription
onClickToggle={async () => {
await toggleLinkPreviews();
forceUpdate();
await toggleLinkPreviews(forceUpdate);
}}
title={window.i18n('linkPreviewsTitle')}
description={window.i18n('linkPreviewDescription')}

@ -351,7 +351,7 @@ export async function deleteMessagesByIdForEveryone(
onClickOk: async () => {
await doDeleteSelectedMessages({ selectedMessages, conversation, deleteForEveryone: true });
// explicity close modal for this case.
// explicitly close modal for this case.
window.inboxStore?.dispatch(updateConfirmModal(null));
return;
},

@ -649,7 +649,7 @@ async function showDebugLogWindow() {
}
if (!mainWindow) {
console.info('debug log neeeds mainwindow size to open');
console.info('debug log needs mainwindow size to open');
return;
}

@ -67,7 +67,6 @@ import _, {
map,
partition,
pick,
reduce,
reject,
size as lodashSize,
sortBy,
@ -474,7 +473,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
convoId: this.get('conversationId'),
};
if (body) {
props.text = this.createNonBreakingLastSeparator(body);
props.text = body;
}
if (this.get('isDeleted')) {
props.isDeleted = this.get('isDeleted');
@ -534,16 +533,6 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return props;
}
public createNonBreakingLastSeparator(text: string) {
const nbsp = '\xa0';
const regex = /(\S)( +)(\S+\s*)$/;
return text.replace(regex, (_match, start, spaces, end) => {
const newSpaces: any =
end.length < 12 ? reduce(spaces, accumulator => accumulator + nbsp, '') : spaces;
return `${start}${newSpaces}${end}`;
});
}
public processQuoteAttachment(attachment: any) {
const { thumbnail } = attachment;
const path = thumbnail && thumbnail.path && getAbsoluteAttachmentPath(thumbnail.path);
@ -643,7 +632,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
if (quote.text) {
// do not show text of not found messages.
// if the message was deleted better not show it's text content in the message
quoteProps.text = this.createNonBreakingLastSeparator(sliceQuoteText(quote.text));
quoteProps.text = sliceQuoteText(quote.text);
}
const quoteAttachment = firstAttachment

@ -24,7 +24,7 @@ if (environment === 'production') {
process.env.ALLOW_CONFIG_MUTATIONS = '';
process.env.SUPPRESS_NO_CONFIG_WARNING = '';
// We could be running againt production but still be in dev mode, we need to handle that
// We could be running against production but still be in dev mode, we need to handle that
if (!electronIsDev) {
process.env.NODE_APP_INSTANCE = '';
}

@ -15,7 +15,7 @@ const { NODE_ENV: environment, NODE_APP_INSTANCE: instance } = process.env;
const isValidInstance = typeof instance === 'string' && instance.length > 0;
const isProduction = environment === 'production' && !isValidInstance;
// Use seperate data directories for each different environment and app instances
// Use separate data directories for each different environment and app instances
if (!isProduction) {
storageProfile = environment;
if (isValidInstance) {

@ -598,7 +598,7 @@ function updateToSessionSchemaVersion20(currentVersion: number, db: BetterSqlite
// obj.profile.displayName is the display as this user set it.
if (obj?.nickname?.length && obj?.profile?.displayName?.length) {
// this one has a nickname set, but name is unset, set it to the displayName in the lokiProfile if it's exisitng
// this one has a nickname set, but name is unset, set it to the displayName in the lokiProfile if it's existing
obj.name = obj.profile.displayName;
sqlNode.saveConversation(obj as ConversationAttributes, db);
}

@ -2147,7 +2147,7 @@ function cleanUpOldOpengroupsOnStart() {
let pruneSetting = getItemById(SettingsKey.settingsOpengroupPruning)?.value;
if (pruneSetting === undefined) {
console.info('Prune settings is undefined (and not explicitely false), forcing it to true.');
console.info('Prune settings is undefined (and not explicitly false), forcing it to true.');
createOrUpdateItem({ id: SettingsKey.settingsOpengroupPruning, value: true });
pruneSetting = true;
}

@ -174,7 +174,7 @@ const handleContactFromConfig = async (
}
}
// only set for explicit true/false values incase outdated sender doesn't have the fields
// only set for explicit true/false values in case outdated sender doesn't have the fields
if (contactReceived.isBlocked === true) {
if (contactConvo.isIncomingRequest()) {
// handling case where restored device's declined message requests were getting restored

@ -391,7 +391,7 @@ export async function handleMessageJob(
void queueAttachmentDownloads(messageModel, conversation);
// Check if we need to update any profile names
// the only profile we don't update with what is coming here is ours,
// as our profile is shared accross our devices with a ConfigurationMessage
// as our profile is shared across our devices with a ConfigurationMessage
if (messageModel.isIncoming() && regularDataMessage.profile) {
void appendFetchAvatarAndProfileJob(
sendingDeviceConversation,
@ -400,7 +400,7 @@ export async function handleMessageJob(
);
}
// even with all the warnings, I am very sus about if this is usefull or not
// even with all the warnings, I am very sus about if this is useful or not
// try {
// // We go to the database here because, between the message save above and
// // the previous line's trigger() call, we might have marked all messages

@ -22,7 +22,7 @@ export type OpenGroupRequestHeaders = {
* @param endpoint endpoint of request we're making
* @param method method of request we're making
* @param blinded is the server being requested to blinded or not
* @param body the body of the request we're mkaing
* @param body the body of the request we're making
* @returns object of headers, including X-SOGS and other headers.
*/
const getOurOpenGroupHeaders = async (

@ -330,7 +330,7 @@ const makeBatchRequestPayload = (
};
/**
* Get the request to get all of the details we care from an opengroup, accross all rooms.
* Get the request to get all of the details we care from an opengroup, across all rooms.
* Only compatible with v4 onion requests.
*
* if isSequence is set to true, each rows will be run in order until the first one fails

@ -63,26 +63,24 @@ const getSslAgentForSeedNode = async (seedNodeHost: string, isSsl = false) => {
}
switch (seedNodeHost) {
case 'storage.seed1.loki.network':
case 'seed1.getsession.org':
certContent = isLinux() ? storageSeed1Crt : Buffer.from(storageSeed1Crt, 'utf-8').toString();
pubkey256 = 'JOsnIcAanVbgECNA8lHtC8f/cqN9m8EP7jKT6XCjeL8=';
pubkey256 = 'mlYTXvkmIEYcpswANTpnBwlz9Cswi0py/RQKkbdQOZQ=';
cert256 =
'6E:2B:AC:F3:6E:C1:FF:FF:24:F3:CA:92:C6:94:81:B4:82:43:DF:C7:C6:03:98:B8:F5:6B:7D:30:7B:16:C1:CB';
'36:EA:0B:25:35:37:98:85:51:EE:85:6E:4F:D2:0D:55:01:1E:9C:8B:27:EA:A2:F3:4B:8F:32:A0:BD:F0:4F:2D';
break;
case 'storage.seed3.loki.network':
certContent = isLinux() ? storageSeed3Crt : Buffer.from(storageSeed3Crt, 'utf-8').toString();
pubkey256 = 'mMmZD3lG4Fi7nTC/EWzRVaU3bbCLsH6Ds2FHSTpo0Rk=';
case 'seed2.getsession.org':
certContent = isLinux() ? storageSeed2Crt : Buffer.from(storageSeed2Crt, 'utf-8').toString();
pubkey256 = 'ZuUxe4wopBR83Yy5fePPNX0c00BnkQCu/49oapFpB0k=';
cert256 =
'24:13:4C:0A:03:D8:42:A6:09:DE:35:76:F4:BD:FB:11:60:DB:F9:88:9F:98:46:B7:60:A6:60:0C:4C:CF:60:72';
'C5:90:8D:D4:13:9A:CD:96:AE:DD:1E:45:57:65:97:65:08:09:C8:A5:EA:02:AF:55:6D:48:53:D4:53:96:E0:E7';
break;
case 'public.loki.foundation':
certContent = isLinux()
? publicLokiFoundationCtr
: Buffer.from(publicLokiFoundationCtr, 'utf-8').toString();
pubkey256 = 'W+Zv52qlcm1BbdpJzFwxZrE7kfmEboq7h3Dp/+Q3RPg=';
case 'seed3.getsession.org':
certContent = isLinux() ? storageSeed3Crt : Buffer.from(storageSeed3Crt, 'utf-8').toString();
pubkey256 = '4xe+8k1NjxerVTjUsWlZJNKt3PA7Y31pUls2tHYippA=';
cert256 =
'40:E4:67:7D:18:6B:4D:08:8D:E9:D5:47:52:25:B8:28:E0:D3:63:99:9B:38:46:7D:92:19:5B:61:B9:AE:0E:EA';
'8A:0A:F2:C7:12:34:2F:22:CE:00:E5:3C:16:01:41:0E:F8:D8:41:56:AE:E0:A9:80:9C:32:F6:F7:EF:BE:55:6E';
break;
@ -311,81 +309,79 @@ async function getSnodesFromSeedUrl(urlObj: URL): Promise<Array<any>> {
}
const storageSeed1Crt = `-----BEGIN CERTIFICATE-----
MIIEITCCAwmgAwIBAgIUJsox1ZQPK/6iDsCC+MUJfNAlFuYwDQYJKoZIhvcNAQEL
BQAwgYAxCzAJBgNVBAYTAkFVMREwDwYDVQQIDAhWaWN0b3JpYTESMBAGA1UEBwwJ
TWVsYm91cm5lMSUwIwYDVQQKDBxPeGVuIFByaXZhY3kgVGVjaCBGb3VuZGF0aW9u
MSMwIQYDVQQDDBpzdG9yYWdlLnNlZWQxLmxva2kubmV0d29yazAeFw0yMTA0MDcw
MTE5M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Lz1yedEUTVkkuVhzSUj5yc8tiwrcagwWX6m
BlfVCJgsBbrJ754rg0AJ0k59wriRamimcUIBvKIo3g3UhJHDI8bt4+SvsRYkSmbi
rzVthAlJjSlRA28X/OLnknWcgEdkGhu0F1tkBtVjIQXd
-----END CERTIFICATE-----
`;
const publicLokiFoundationCtr = `-----BEGIN CERTIFICATE-----
MIIEEzCCAvugAwIBAgIUY9RQqbjhsQEkdeSgV9L0os9xZ7AwDQYJKoZIhvcNAQEL
BQAwfDELMAkGA1UEBhMCQVUxETAPBgNVBAgMCFZpY3RvcmlhMRIwEAYDVQQHDAlN
const storageSeed3Crt = `-----BEGIN CERTIFICATE-----
MIIEDTCCAvWgAwIBAgIUTz5rHKUe+VA9IM6vY6QACc0ORFkwDQYJKoZIhvcNAQEL
BQAwejELMAkGA1UEBhMCQVUxETAPBgNVBAgMCFZpY3RvcmlhMRIwEAYDVQQHDAlN
ZWxib3VybmUxJTAjBgNVBAoMHE94ZW4gUHJpdmFjeSBUZWNoIEZvdW5kYXRpb24x
HzAdBgNVBAMMFnB1YmxpYy5sb2tpLmZvdW5kYXRpb24wHhcNMjEwNDA3MDExMDMx
WhcNMjMwNDA3MDExMDMxWjB8MQswCQYDVQQGEwJBVTERMA8GA1UECAwIVmljdG9y
aWExEjAQBgNVBAcMCU1lbGJvdXJuZTElMCMGA1UECgwcT3hlbiBQcml2YWN5IFRl
Y2ggRm91bmRhdGlvbjEfMB0GA1UEAwwWcHVibGljLmxva2kuZm91bmRhdGlvbjCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM5dBJSIR5+VNNUxUOo6FG0e
RmZteRqBt50KXGbOi2A23a6sa57pLFh9Yw3hmlWV+QCL7ipG1X4IC55OStgoesf+
K65VwEMP6Mtq0sSJS3R5TiuV2ZSRdSZTVjUyRXVe5T4Aw6wXVTAbc/HsyS780tDh
GclfDHhonPhZpmTAnSbfMOS+BfOnBNvDxdto0kVh6k5nrGlkT4ECloulHTQF2lwJ
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iJxBRhfQGJ7vbwJZ1AwVJisjDFdiLcWzTF8
gzZ7LVXH8qlVnqcx0gksrWYFnG3Y2WJrxEBFdD29lP7LVN3xLQdplMitOciqg5jN
oRjtwGo+wzaMW6WNPzgTvxLzPce9Rl3oN4tSK7qlA9VtsyHwOWBMcogv9LC9IUFZ
2yu0RdcxPdlwLwywYtSRt/W87KbAWTcYY1DfN2VA68p9Cip7/dPOokRduMh1peux
swmIybpC/wz/Ql6J6scSOjDUp/2UsIdYIvyP/Dibi4nHRmD+oz9kb+J3AQIDAQAB
o4GKMIGHMB0GA1UdDgQWBBSQAFetDPIzVg9rfgOI7bfaeEHd8TAfBgNVHSMEGDAW
gBSQAFetDPIzVg9rfgOI7bfaeEHd8TAPBgNVHRMBAf8EBTADAQH/MB8GA1UdEQQY
MBaCFHNlZWQzLmdldHNlc3Npb24ub3JnMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA0G
CSqGSIb3DQEBCwUAA4IBAQCiBNdbKNSHyCZJKvC/V+pHy9E/igwvih2GQ5bNZJFA
daOiKBgaADxaxB4lhtzasr2LdgZdLrn0oONw+wYaui9Z12Yfdr9oWuOgktn8HKLY
oKkJc5EcMYFsd00FnnFcO2U8lQoL6PB/tdcEmpOfqtvShpNhp8SbadSNiqlttvtV
1dqvqSBiRdQm1kz2b8hA6GR6SPzSKlSuwI0J+ZcXEi232EJFbgJ3ESHFVHrhUZro
8A16/WDvZOMWCjOqJsFBw15WzosW9kyNwBtZinXVO3LW/7tVl08PDcarpH4IWjd0
LDpU7zGjcD/A19tfdfMFTOmETuq40I8xxtlR2NENFOAL
-----END CERTIFICATE-----
`;

@ -567,7 +567,7 @@ export async function retrieveNextMessages(
}
/**
* Makes a post to a node to receive the timestamp info. If non-existant, returns -1
* Makes a post to a node to receive the timestamp info. If non-existent, returns -1
* @param snode Snode to send request to
* @returns timestamp of the response from snode
*/

@ -727,7 +727,7 @@ async function handle421InvalidSwarm({
associatedWith,
});
// this is important we throw so another retry is made and we exit the handling of that reponse
// this is important we throw so another retry is made and we exit the handling of that response
throw new pRetry.AbortError(ERROR_421_HANDLED_RETRY_REQUEST);
}

@ -260,7 +260,7 @@ async function dropPathStartingWithGuardNode(guardNodeEd25519: string) {
guardNodes = guardNodes.filter(g => g.pubkey_ed25519 !== guardNodeEd25519);
// write the updates guard nodes to the db.
await internalUpdateGuardNodes(guardNodes);
// we are dropping it. Reset the counter in case this same guard gets choosen later
// we are dropping it. Reset the counter in case this same guard gets chosen later
pathFailureCount[guardNodeEd25519] = 0;
// trigger path rebuilding for the dropped path. This will throw if anything happens
@ -516,7 +516,7 @@ async function buildNewOnionPathsWorker() {
minTimeout: 1000,
onFailedAttempt: e => {
window?.log?.warn(
`buildNewOnionPathsWorker attemp #${e.attemptNumber} failed. ${e.retriesLeft} retries left... Error: ${e.message}`
`buildNewOnionPathsWorker attempt #${e.attemptNumber} failed. ${e.retriesLeft} retries left... Error: ${e.message}`
);
},
}

@ -175,7 +175,7 @@ async function handleMessageSentFailure(
/**
* This function tries to find a message by messageId by first looking on the MessageController.
* The MessageController holds all messages being in memory.
* Those are the messages sent recently, recieved recently, or the one shown to the user.
* Those are the messages sent recently, received recently, or the one shown to the user.
*
* If the app restarted, it's very likely those messages won't be on the memory anymore.
* In this case, this function will look for it in the database and return it.

@ -236,7 +236,7 @@ async function _runJob(job: any) {
// so there is no need to continue trying to download it.
if (currentAttempt >= 3 || was404Error(error)) {
logger.error(
`_runJob: ${currentAttempt} failed attempts, marking attachment ${id} from message ${found?.idForLogging()} as permament error:`,
`_runJob: ${currentAttempt} failed attempts, marking attachment ${id} from message ${found?.idForLogging()} as permanent error:`,
error && error.stack ? error.stack : error
);

@ -166,7 +166,7 @@ export async function poll(
}
/**
* Creates a promise which waits until `check` returns `true` or rejects if `timeout` preiod is reached.
* Creates a promise which waits until `check` returns `true` or rejects if `timeout` period is reached.
* If `timeout` is reached then this will throw an Error.
*
* @param check The boolean check.

@ -26,7 +26,7 @@ export function combineKeys(
//
// BLAKE2b(a kB || kA || kB)
//
// The receiver can calulate the same value via:
// The receiver can calculate the same value via:
//
// BLAKE2b(b kA || kA || kB)
export function sharedBlindedEncryptionKey({

@ -509,7 +509,7 @@ export async function USER_callRecipient(recipient: string) {
callNotificationType: 'started-call',
});
// initiating a call is analgous to sending a message request
// initiating a call is analogous to sending a message request
await approveConvoAndSendResponse(recipient, true);
// we do it manually as the sendToPubkeyNonDurably rely on having a message saved to the db for MessageSentSuccess
@ -521,7 +521,7 @@ export async function USER_callRecipient(recipient: string) {
await openMediaDevicesAndAddTracks();
await createOfferAndSendIt(recipient);
// close and end the call if callTimeoutMs is reached ans still not connected
// close and end the call if callTimeoutMs is reached and still not connected
global.setTimeout(async () => {
if (justCreatedCallUUID === currentCallUUID && getIsRinging()) {
window.log.info(
@ -751,7 +751,7 @@ function createOrGetPeerConnection(withPubkey: string) {
);
if (peerConnection && peerConnection?.iceConnectionState === 'disconnected') {
//this will trigger a negotation event with iceRestart set to true in the createOffer options set
//this will trigger a negotiation event with iceRestart set to true in the createOffer options set
global.setTimeout(async () => {
window.log.info('onconnectionstatechange disconnected: restartIce()');

@ -301,7 +301,7 @@ export type ConversationsStateType = {
* Saving it here, make it possible to restore the position of the user before the refresh by pointing
* at that same messageId and aligning the list to the top.
*
* Once the view scrolled, this value is reseted by resetOldTopMessageId
* Once the view scrolled, this value is reset by resetOldTopMessageId
*/
oldTopMessageId: string | null;
@ -310,7 +310,7 @@ export type ConversationsStateType = {
* Saving it here, make it possible to restore the position of the user before the refresh by pointing
* at that same messageId and aligning the list to the bottom.
*
* Once the view scrolled, this value is reseted by resetOldBottomMessageId
* Once the view scrolled, this value is reset by resetOldBottomMessageId
*/
oldBottomMessageId: string | null;

@ -467,7 +467,7 @@ const decryptBlindedMessage = async (
if (plaintextIncoming.length <= 32) {
// throw Error;
window?.log?.error('decryptBlindedMessage: plaintext unsufficient length');
window?.log?.error('decryptBlindedMessage: plaintext insufficient length');
return;
}

@ -94,7 +94,7 @@ describe('OnionPathsErrors', () => {
stubData('getSwarmNodesForPubkey').resolves(fakeSwarmForAssociatedWith);
updateGuardNodesStub = stubData('updateGuardNodes').resolves();
// those are still doing what they do, but we spy on their executation
// those are still doing what they do, but we spy on their execution
updateSwarmSpy = stubData('updateSwarmNodesForPubkey').resolves();
stubData('getItemById').resolves({ id: SNODE_POOL_ITEM_ID, value: '' });
stubData('createOrUpdateItem').resolves();

@ -53,7 +53,7 @@ describe('Padding', () => {
});
it('add padding if the attachment is already too big', () => {
// we just want to make sure we do not overide attachment data. The file upload will fail, but at least make sure to keep the user data.
// we just want to make sure we do not override attachment data. The file upload will fail, but at least make sure to keep the user data.
const bufferIn = new Uint8Array(MAX_ATTACHMENT_FILESIZE_BYTES + 1);
const paddedBuffer = addAttachmentPadding(bufferIn);
const expectedPaddedSize = Math.floor(

@ -145,7 +145,7 @@ describe('MessageSender', () => {
expect(decodedTimestampFromSending).to.be.above(expectedTimestamp - 10);
expect(decodedTimestampFromSending).to.be.below(expectedTimestamp + 10);
// then make sure the plaintextBuffer was overriden too
// then make sure the plaintextBuffer was overridden too
const visibleMessageExpected = TestUtils.generateVisibleMessage({
timestamp: decodedTimestampFromSending,
});

@ -311,7 +311,7 @@ describe('mutationCache', () => {
server: roomInfos.serverUrl,
room: roomInfos.roomId,
changeType: ChangeType.REACTIONS,
seqno: 300, // greater than response messageResponse seqno should be procesed
seqno: 300, // greater than response messageResponse seqno should be processed
metadata: {
messageId: originalMessage.serverId,
emoji: '😄',
@ -322,7 +322,7 @@ describe('mutationCache', () => {
server: roomInfos.serverUrl,
room: roomInfos.roomId,
changeType: ChangeType.REACTIONS,
seqno: 301, //// greater than response messageResponse seqno should be procesed
seqno: 301, //// greater than response messageResponse seqno should be processed
metadata: {
messageId: originalMessage.serverId,
emoji: '😈',

@ -95,13 +95,13 @@ describe('knownBlindedKeys', () => {
describe('writeKnownBlindedKeys', () => {
it('writeKnownBlindedKeys with null', async () => {
// the cached blinded keys is resetted on each test, so that first one we try to write null
// the cached blinded keys is reset on each test, so that first one we try to write null
await writeKnownBlindedKeys();
expect(createOrUpdateItem.notCalled).to.be.true;
});
it('writeKnownBlindedKeys with null but loaded', async () => {
// the cached blinded keys is resetted on each test, so that first one we try to write null
// the cached blinded keys is reset on each test, so that first one we try to write null
getItemById.resolves(null);
await loadKnownBlindedKeys();

@ -42,7 +42,7 @@ describe('JobQueue', () => {
const start = Date.now();
await assert.eventually.deepEqual(Promise.all(input.map(mapper)), [10, 20, 30]);
const timeTaken = Date.now() - start;
assert.isAtLeast(timeTaken, 20, 'Queue should take atleast 100ms to run.');
assert.isAtLeast(timeTaken, 20, 'Queue should take at least 100ms to run.');
});
it('should return the result of the job', async () => {

@ -1,7 +1,7 @@
import { hexColorToRGB } from '../util/hexColorToRGB';
import { COLORS } from './constants/colors';
// These variables are independant of the current theme
// These variables are independent of the current theme
export type ThemeGlobals = {
/* Fonts */
'--font-default': string;

@ -117,7 +117,7 @@ export interface Reaction {
action: Action;
}
// used for logic operations with reactions i.e reponses, db, etc.
// used for logic operations with reactions i.e responses, db, etc.
export type ReactionList = Record<
string,
{

@ -62,7 +62,7 @@ export async function autoScaleForAvatar<T extends { contentType: string; blob:
attachment.contentType !== IMAGE_JPEG
) {
// nothing to do
throw new Error('Cannot autoScaleForAvatar another file than PNG,GIF or JPEG.');
throw new Error('Cannot autoScaleForAvatar another file than PNG, GIF or JPEG.');
}
window.log.info('autoscale for avatar', maxMeasurements);

@ -30,7 +30,7 @@ export class BlockedNumberController {
/**
* Check if a device is blocked synchronously.
* This will only check against the memory cache on if a device is blocked, it is reccomended to pass in the primary device pub key.
* This will only check against the memory cache on if a device is blocked, it is recommended to pass in the primary device pub key.
*
* Make sure `load()` has been called before this function so that the correct blocked state is returned.
*

@ -20,7 +20,7 @@ export async function destroyMessagesAndUpdateRedux(
const conversationWithChanges = uniq(messages.map(m => m.conversationKey));
try {
// Delete all thoses messages in a single sql call
// Delete all those messages in a single sql call
await Data.removeMessagesByIds(messages.map(m => m.messageId));
} catch (e) {
window.log.error('destroyMessages: removeMessagesByIds failed', e && e.message ? e.message : e);

@ -72,7 +72,7 @@ async function fetchWithRedirects(
}
urlsSeen.add(nextHrefToLoad);
// This `await` is deliberatly inside of a loop.
// This `await` is deliberately inside of a loop.
// eslint-disable-next-line no-await-in-loop
const response = await fetchFn(nextHrefToLoad, {
...options,

@ -126,7 +126,7 @@ function isLinkSneaky(href: string) {
return true;
}
// This is necesary because getDomain returns domains in punycode form.
// This is necessary because getDomain returns domains in punycode form.
const unicodeDomain = nodeUrl.domainToUnicode
? nodeUrl.domainToUnicode(url.hostname)
: url.hostname;

@ -0,0 +1,29 @@
import { saveURLAsFile } from './saveURLAsFile';
export function saveQRCode(
filename: string,
width: string,
height: string,
backgroundColor: string,
foregroundColor: string
): void {
const qrSVG = document.querySelector('.qr-image svg');
if (qrSVG) {
// tslint:disable-next-line: no-http-string
qrSVG.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
qrSVG.setAttribute('width', width);
qrSVG.setAttribute('height', height);
let content = qrSVG.outerHTML;
content = content.replaceAll(backgroundColor, 'white');
content = content.replaceAll(foregroundColor, 'black');
const file = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(file);
saveURLAsFile({
filename: `${filename}-${new Date().toISOString()}.svg`,
url,
document,
});
} else {
window.log.info('[saveQRCode] QR code not found');
}
}
Loading…
Cancel
Save