mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
refactor(server/contacts): Implement singleton architecture
This commit is contained in:
1 parent
16471ed1df
commit
f8f722c8d2
9 files changed
+200
-136
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { ContactEvents } from '../../typings/contact';
|
||||
import { ContactEvents, PreDBContact } from '../../typings/contact';
|
||||
import { sendContactsEvent } from '../utils/messages';
|
||||
|
||||
onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||
@@ -6,8 +6,8 @@ onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(ContactEvents.ADD_CONTACT);
|
||||
on(`__cfx_nui:${ContactEvents.ADD_CONTACT}`, (data: any, cb: Function) => {
|
||||
emitNet(ContactEvents.ADD_CONTACT, data.number, data.display, data.avatar);
|
||||
on(`__cfx_nui:${ContactEvents.ADD_CONTACT}`, (data: PreDBContact, cb: Function) => {
|
||||
emitNet(ContactEvents.ADD_CONTACT, data);
|
||||
cb();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user