Skip to content

Commit 5ec6f35

Browse files
committed
Add comments
1 parent ecb67b3 commit 5ec6f35

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/lib/services/voip/MediaSessionInstance.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@rocket.chat/media-signaling';
99
import RNCallKeep from 'react-native-callkeep';
1010
import { registerGlobals } from 'react-native-webrtc';
11+
import { getUniqueId } from 'react-native-device-info';
1112

1213
import { mediaSessionStore } from './MediaSessionStore';
1314
import { useCallStore } from './useCallStore';
@@ -61,6 +62,11 @@ class MediaSessionInstance {
6162
}
6263
const signal = ddpMessage.fields.args[0];
6364
this.instance.processSignal(signal);
65+
66+
// If the call was accepted from another device, end the call
67+
if (signal.type === 'notification' && signal.notification === 'accepted' && signal.signedContractId !== getUniqueId()) {
68+
// TODO: pop from call view, end callkeep and remove incoming call notification
69+
}
6470
});
6571

6672
this.instance?.on('newCall', ({ call }: { call: IClientMediaCall }) => {

app/lib/services/voip/useCallStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const useCallStore = create<CallStore>((set, get) => ({
172172
set({ dialpadValue: newValue });
173173
},
174174

175+
// TODO: do it here or in MediaSessionInstance?
175176
endCall: () => {
176177
const { call, callId } = get();
177178

0 commit comments

Comments
 (0)