Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send approved message only when previously unapproved #3254

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.1",
"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
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
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
Loading