chore: update core v3.8.1

This commit is contained in:
Bloomingg
2024-09-29 21:49:33 +08:00
parent 83ee57f324
commit 4ac70c34e2
8 changed files with 34 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
{
"name": "@openim/electron-client-sdk",
"version": "1.1.0",
"version": "1.1.1",
"description": "open im sdk for node",
"source": "src/index.ts",
"main": "lib/index.js",
@@ -43,7 +43,7 @@
"devDependencies": {
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@openim/wasm-client-sdk": "^3.8.2-beta.4",
"@openim/wasm-client-sdk": "^3.8.2",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-terser": "^0.4.4",
"@types/ffi-napi": "^4.0.10",
@@ -80,7 +80,7 @@
"uuid": "^9.0.0"
},
"peerDependencies": {
"@openim/wasm-client-sdk": "^3.8.2-beta.3",
"@openim/wasm-client-sdk": "^3.8.2",
"electron": ">=12.0.0"
}
}

View File

@@ -60,9 +60,16 @@ class OpenIMSDK
listenerCallback: koffi.IKoffiRegisteredCallback;
lib: koffi.IKoffiLib;
enterprise: boolean;
basertc: boolean;
constructor(libPath: string, emitProxy?: EmitProxy, enterprise = false) {
constructor(
libPath: string,
emitProxy?: EmitProxy,
enterprise = false,
basertc = false
) {
super();
this.basertc = basertc;
this.enterprise = enterprise;
this.lib = koffi.load(libPath);
this.baseCallbackProto = koffi.proto('__stdcall', 'baseCallback', 'void', [
@@ -838,19 +845,7 @@ class OpenIMSDK
]);
// advance
if (this.enterprise) {
this.libOpenIMSDK.send_group_message_read_receipt = this.lib.func(
'__stdcall',
'send_group_message_read_receipt',
'void',
['baseCallback *', 'str', 'str', 'str']
);
this.libOpenIMSDK.get_group_message_reader_list = this.lib.func(
'__stdcall',
'get_group_message_reader_list',
'void',
['baseCallback *', 'str', 'str', 'str', 'int', 'int', 'int']
);
if (this.basertc || this.enterprise) {
this.libOpenIMSDK.set_signaling_listener = this.lib.func(
'__stdcall',
'set_signaling_listener',
@@ -927,6 +922,20 @@ class OpenIMSDK
['baseCallback *', 'str', 'str', 'str']
);
}
if (this.enterprise) {
this.libOpenIMSDK.send_group_message_read_receipt = this.lib.func(
'__stdcall',
'send_group_message_read_receipt',
'void',
['baseCallback *', 'str', 'str', 'str']
);
this.libOpenIMSDK.get_group_message_reader_list = this.lib.func(
'__stdcall',
'get_group_message_reader_list',
'void',
['baseCallback *', 'str', 'str', 'str', 'int', 'int', 'int']
);
}
};
generateEventResponse = (
@@ -1075,7 +1084,7 @@ class OpenIMSDK
this.libOpenIMSDK.set_advanced_msg_listener(this.listenerCallback);
this.libOpenIMSDK.set_batch_msg_listener(this.listenerCallback);
this.libOpenIMSDK.set_custom_business_listener(this.listenerCallback);
if (this.enterprise) {
if (this.enterprise || this.basertc) {
this.libOpenIMSDK.set_signaling_listener(this.listenerCallback);
}
};

View File

@@ -5,8 +5,13 @@ import OpenIMSDK from './core';
class OpenIMSDKMain {
private sdk: OpenIMSDK;
private webContents: WebContents[] = [];
constructor(path: string, webContent?: WebContents, enterprise = false) {
this.sdk = new OpenIMSDK(path, this.emitProxy, enterprise);
constructor(
path: string,
webContent?: WebContents,
enterprise = false,
basertc = false
) {
this.sdk = new OpenIMSDK(path, this.emitProxy, enterprise, basertc);
if (webContent) {
this.webContents = [webContent];
}