fix(adding correct events

This commit is contained in:
Christopher committed 2021-01-26 22:07:28 +01:00
1 parent a7f3f50f3d
commit 7eb4b09f5c
1 file changed
+4 -4
+4 -4
View File
@@ -99,10 +99,10 @@ onNet(events.PHONE_END_CALL, async (phoneNumber: string) => {
const channelId = pSource; const channelId = pSource;
// client that is calling // client that is calling
emitNet(events.PHONE_CALL_WAS_ACCEPTED, pSource, channelId); emitNet(events.PHONE_CALL_WAS_ENDED, pSource, channelId);
// client that is being called // client that is being called
emitNet(events.PHONE_CALL_WAS_ACCEPTED, targetPlayer.source, channelId); emitNet(events.PHONE_CALL_WAS_ENDED, targetPlayer.source, channelId);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
@@ -118,10 +118,10 @@ onNet(events.PHONE_CALL_REJECTED, async (phoneNumber: string) => {
const targetPlayer = await getPlayerFromIdentifier(targetIdentifier); const targetPlayer = await getPlayerFromIdentifier(targetIdentifier);
// client that is calling // client that is calling
emitNet(events.PHONE_CALL_WAS_ACCEPTED, pSource); emitNet(events.PHONE_CALL_WAS_REJECTED, pSource);
// client that is being called // client that is being called
emitNet(events.PHONE_CALL_WAS_ACCEPTED, targetPlayer.source); emitNet(events.PHONE_CALL_WAS_REJECTED, targetPlayer.source);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }