Merge pull request #2896 from oxen-io/clearnet

merge clearnet to unstable
pull/2897/head
Audric Ackermann 9 months ago committed by GitHub
commit 5fcad9ce4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,11 @@ module.exports = {
root: true,
settings: {
'import/core-modules': ['electron'],
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit "$1"

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

@ -0,0 +1,29 @@
const ignoredFiles = [
'package.json',
'yarn.lock',
'tsconfig.json',
'.lintstagedrc.js',
'.eslintrc.js',
];
const path = require('path');
const buildFormatCommand = filenames => {
const results = filenames
.map(f => path.relative(process.cwd(), f))
.filter(f => !ignoredFiles.includes(f));
return results.length ? `prettier --list-different --write ${results.join(' ')}` : '';
};
const buildLintCommand = filenames => {
const results = filenames
.map(f => path.relative(process.cwd(), f))
.filter(f => !ignoredFiles.includes(f));
return results.length ? `eslint --cache ${results.join(' ')}` : '';
};
module.exports = {
'*.{css,js,json,scss,ts,tsx}': [buildFormatCommand, buildLintCommand],
};

@ -37,3 +37,7 @@ Gruntfile.js
!istanbul-reports/lib/html/assets
!istanbul-api/node_modules/istanbul-reports/lib/html/assets
# lint-staged fix
# https://github.com/eemeli/yaml/issues/384#issuecomment-1368496106
!**/yaml/dist/**/doc

@ -10,7 +10,7 @@ It's a good idea to gauge interest in your intended work by finding the current
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.
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.
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.
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.
@ -45,10 +45,10 @@ Building on Windows versions 8+ is supported out of the box
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
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
```
apt install build-essential
```
### All platforms
@ -129,6 +129,16 @@ Please write tests! Our testing framework is
The easiest way to run all tests at once is `yarn test`.
## Committing your changes
Before a commit is accepted the staged changes will be formatted using [prettier](https://prettier.io/) and linted using [eslint](https://eslint.org/). The commit will be reverted if files are formatted or lint errors are returned.
### Commit Message Convention
This project follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
Commit messages will be checked using [husky](https://typicode.github.io/husky/#/) and [commitlint](https://commitlint.js.org/).
## Pull requests
So you wanna make a pull request? Please observe the following guidelines.

@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };

@ -64,7 +64,8 @@
"postinstall": "yarn patch-package && yarn electron-builder install-app-deps",
"update-git-info": "node ./build/updateLocalConfig.js",
"worker:utils": "webpack --config=./utils.worker.config.js",
"worker:libsession": "rimraf 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js"
"worker:libsession": "rimraf 'ts/webworker/workers/node/libsession/*.node' && webpack --config=./libsession.worker.config.js",
"prepare": "husky install"
},
"dependencies": {
"@emoji-mart/data": "^1.1.2",
@ -132,6 +133,9 @@
"webrtc-adapter": "^4.1.1"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@commitlint/types": "^17.4.4",
"@electron/notarize": "^2.1.0",
"@types/backbone": "1.4.2",
"@types/blueimp-load-image": "5.14.4",
@ -182,8 +186,10 @@
"eslint-plugin-react": "^7.33.0",
"eslint-plugin-react-hooks": "^4.6.0",
"events": "^3.3.0",
"husky": "^8.0.0",
"jsdom": "^22.1.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^14.0.1",
"mini-css-extract-plugin": "^2.7.5",
"mocha": "10.0.0",
"node-loader": "^2.0.0",

@ -86,7 +86,7 @@ const StyledMessageOpaqueContent = styled(StyledMessageHighlighter)<{
align-self: ${props => (props.messageDirection === 'incoming' ? 'flex-start' : 'flex-end')};
padding: var(--padding-message-content);
border-radius: var(--border-radius-message-box);
max-width: 100%;
width: 100%;
`;
export const IsMessageVisibleContext = createContext(false);

@ -24,18 +24,6 @@ import {
showMessageDetailsView,
toggleSelectedMessageId,
} from '../../../../state/ducks/conversations';
import {
useSelectedConversationKey,
useSelectedIsBlocked,
useSelectedIsPublic,
useSelectedWeAreAdmin,
useSelectedWeAreModerator,
} from '../../../../state/selectors/selectedConversation';
import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil';
import { Reactions } from '../../../../util/reactions';
import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer';
import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel';
import { MessageReactBar } from './MessageReactBar';
import {
useMessageAttachments,
useMessageBody,
@ -48,7 +36,18 @@ import {
useMessageStatus,
useMessageTimestamp,
} from '../../../../state/selectors';
import { useIsPublic } from '../../../../hooks/useParamSelector';
import {
useSelectedConversationKey,
useSelectedIsBlocked,
useSelectedIsPublic,
useSelectedWeAreAdmin,
useSelectedWeAreModerator,
} from '../../../../state/selectors/selectedConversation';
import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil';
import { Reactions } from '../../../../util/reactions';
import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer';
import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel';
import { MessageReactBar } from './MessageReactBar';
export type MessageContextMenuSelectorProps = Pick<
MessageRenderingProps,
@ -149,10 +148,11 @@ const SaveAttachment = ({ messageId }: MessageId) => {
const AdminActionItems = ({ messageId }: MessageId) => {
const convoId = useSelectedConversationKey();
const isPublic = useIsPublic();
const isPublic = useSelectedIsPublic();
const weAreModerator = useSelectedWeAreModerator();
const weAreAdmin = useSelectedWeAreAdmin();
const showAdminActions = (weAreAdmin || weAreModerator) && isPublic;
const sender = useMessageSender(messageId);
const isSenderAdmin = useMessageSenderIsAdmin(messageId);

@ -86,7 +86,7 @@ export const OverlayMessage = () => {
const pubkeyorOnsTrimmed = pubkeyOrOns.trim();
if (!PubKey.validateWithErrorNoBlinding(pubkeyorOnsTrimmed)) {
await openConvoOnceResolved(pubkeyOrOns);
await openConvoOnceResolved(pubkeyorOnsTrimmed);
return;
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save