Skip to content

Commit

Permalink
Merge pull request #3255 from oxen-io/unstable
Browse files Browse the repository at this point in the history
Session 1.14.3
  • Loading branch information
Bilb authored Dec 5, 2024
2 parents 3cadc54 + ea0d5e1 commit 8d40f0a
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
# We want a mac arm64 build, and according to this https://github.com/actions/runner-images#available-images macos-14 is always arm64
# macos-14 is disabled for now as we hit our free tier limit for macos builds
build_macos_x64:
runs-on: macos-12
runs-on: macos-13
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }}
Expand Down
1 change: 0 additions & 1 deletion INTERNALBUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Building on windows should work straight out of the box, but if it fails then yo

```
npm install --global --production [email protected]
npm install --global node-gyp@latest
npm config set python python2.7
npm config set msvs_version 2015
```
Expand Down
6 changes: 0 additions & 6 deletions actions/setup_and_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ runs:
uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
shell: bash
run: |
yarn global add node-gyp@latest
- uses: actions/cache/restore@v4
id: cache-desktop-modules
with:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.14.2",
"version": "1.14.3",
"license": "GPL-3.0",
"author": {
"name": "Oxen Labs",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/oxen-io/session-desktop.git"
"url": "https://github.com/session-foundation/session-desktop.git"
},
"main": "ts/mains/main_node.js",
"resolutions": {
Expand Down
1 change: 0 additions & 1 deletion ts/components/dialog/OpenUrlModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export function OpenUrlModal(props: OpenUrlModalState) {
/>
<SessionButton
text={window.i18n('urlCopy')}
buttonColor={SessionButtonColor.White}
buttonType={SessionButtonType.Simple}
onClick={onClickCopy}
dataTestId="session-confirm-cancel-button"
Expand Down
19 changes: 17 additions & 2 deletions ts/components/leftpane/ActionsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ipcRenderer } from 'electron';
import { debounce } from 'lodash';
import { useEffect, useRef, useState } from 'react';

import { useDispatch, useSelector } from 'react-redux';
import useInterval from 'react-use/lib/useInterval';
import useTimeoutFn from 'react-use/lib/useTimeoutFn';
import useThrottleFn from 'react-use/lib/useThrottleFn';

import { Data } from '../../data/data';
import { getConversationController } from '../../session/conversations';
Expand Down Expand Up @@ -37,18 +39,18 @@ import { LeftPaneSectionContainer } from './LeftPaneSectionContainer';

import { SettingsKey } from '../../data/settings-key';
import { useFetchLatestReleaseFromFileServer } from '../../hooks/useFetchLatestReleaseFromFileServer';
import { useHotkey } from '../../hooks/useHotkey';
import {
forceRefreshRandomSnodePool,
getFreshSwarmFor,
} from '../../session/apis/snode_api/snodePool';
import { ConfigurationSync } from '../../session/utils/job_runners/jobs/ConfigurationSyncJob';
import { getIsModalVisble } from '../../state/selectors/modal';
import { useIsDarkTheme } from '../../state/selectors/theme';
import { switchThemeTo } from '../../themes/switchTheme';
import { ReleasedFeatures } from '../../util/releaseFeature';
import { getOppositeTheme } from '../../util/theme';
import { SessionNotificationCount } from '../icon/SessionNotificationCount';
import { useHotkey } from '../../hooks/useHotkey';
import { getIsModalVisble } from '../../state/selectors/modal';

const Section = (props: { type: SectionType }) => {
const ourNumber = useSelector(getOurNumber);
Expand Down Expand Up @@ -238,6 +240,19 @@ export const ActionsPanel = () => {
return () => clearTimeout(timeout);
}, []);

const globalUnreadMessageCount = useSelector(getGlobalUnreadMessageCount);

// Reuse the unreadToShow from the global state to update the badge count
useThrottleFn(
(unreadCount: number) => {
if (globalUnreadMessageCount !== undefined) {
ipcRenderer.send('update-badge-count', unreadCount);
}
},
2000,
[globalUnreadMessageCount]
);

useInterval(cleanUpOldDecryptedMedias, startCleanUpMedia ? cleanUpMediasInterval : null);

useFetchLatestReleaseFromFileServer();
Expand Down
2 changes: 1 addition & 1 deletion ts/interactions/conversationInteractions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function unblockConvoById(conversationId: string) {
export const approveConvoAndSendResponse = async (conversationId: string) => {
const convoToApprove = getConversationController().get(conversationId);

if (!convoToApprove) {
if (!convoToApprove || convoToApprove.isApproved()) {
window?.log?.info('Conversation is already approved.');
return;
}
Expand Down
11 changes: 10 additions & 1 deletion ts/mains/main_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
dialog,
protocol as electronProtocol,
ipcMain as ipc,
ipcMain,
IpcMainEvent,
Menu,
nativeTheme,
Expand All @@ -27,7 +28,7 @@ import { platform as osPlatform } from 'process';
import url from 'url';

import Logger from 'bunyan';
import _, { isEmpty } from 'lodash';
import _, { isEmpty, isNumber, isFinite } from 'lodash';
import pify from 'pify';

import { setupGlobalErrorHandler } from '../node/global_errors'; // checked - only node
Expand Down Expand Up @@ -1019,6 +1020,14 @@ ipc.on('get-start-in-tray', event => {
}
});

ipcMain.on('update-badge-count', (_event, count) => {
if (app.isReady()) {
app.setBadgeCount(
isNumber(count) && isFinite(count) && count >= 0 ? count : 0
);
}
});

ipc.on('get-opengroup-pruning', event => {
try {
const val = userConfig.get('opengroupPruning');
Expand Down
5 changes: 5 additions & 0 deletions ts/session/utils/calling/CallManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { MessageSender } from '../../sending';
import { getIsRinging } from '../RingingManager';
import { getBlackSilenceMediaStream } from './Silence';
import { ed25519Str } from '../String';
import { sleepFor } from '../Promise';

export type InputItem = { deviceId: string; label: string };

Expand Down Expand Up @@ -534,6 +535,10 @@ export async function USER_callRecipient(recipient: string) {
calledConvo.set('active_at', Date.now()); // addSingleOutgoingMessage does the commit for us on the convo
await calledConvo.unhideIfNeeded(false);
weAreCallerOnCurrentCall = true;
// Not ideal, but also temporary (see you in 2 years).
// We need to make sure the preoffer AND the messageRequestResponse sent in
// approveConvoAndSendResponse have different timestamps, as iOS will throw an error otherwise
await sleepFor(2);

// initiating a call is analogous to sending a message request
await approveConvoAndSendResponse(recipient);
Expand Down

0 comments on commit 8d40f0a

Please sign in to comment.