tweak(server/calls): Tweaked call handling

Added Sanity checks

Switched timestamp creation to server
This commit is contained in:
Taso authored and Taso committed 2021-03-16 16:24:27 -04:00
1 parent bc8a89d825
commit adf9758d9f
2 files changed
+21 -11

No files matched your search

+2 -4
View File
@@ -6,8 +6,7 @@ const exp = (global as any).exports;
RegisterNuiCallbackType(events.PHONE_INITIALIZE_CALL); // Fires when the call is started.
on(`__cfx_nui:${events.PHONE_INITIALIZE_CALL}`, (data: any, cb: Function) => {
const start = Date.now();
emitNet(events.PHONE_INITIALIZE_CALL, data.number, start);
emitNet(events.PHONE_INITIALIZE_CALL, data.number);
cb();
});
@@ -58,8 +57,7 @@ onNet(
RegisterNuiCallbackType(events.PHONE_CALL_REJECTED); // Fires when cancelling and rejecting a call.
on(`__cfx_nui:${events.PHONE_CALL_REJECTED}`, (data: any, cb: Function) => {
const end = Date.now();
emitNet(events.PHONE_CALL_REJECTED, data.phoneNumber, end);
emitNet(events.PHONE_CALL_REJECTED, data.phoneNumber);
cb();
});