diff --git a/assets/linux_arm64/libopenimsdk.so b/assets/linux_arm64/libopenimsdk.so index e0bd77c..4127fc4 100644 Binary files a/assets/linux_arm64/libopenimsdk.so and b/assets/linux_arm64/libopenimsdk.so differ diff --git a/assets/linux_x64/libopenimsdk.so b/assets/linux_x64/libopenimsdk.so index cf86493..678dc8e 100644 Binary files a/assets/linux_x64/libopenimsdk.so and b/assets/linux_x64/libopenimsdk.so differ diff --git a/assets/mac_arm64/libopenimsdk.dylib b/assets/mac_arm64/libopenimsdk.dylib index 6f3288f..83cbbf6 100644 Binary files a/assets/mac_arm64/libopenimsdk.dylib and b/assets/mac_arm64/libopenimsdk.dylib differ diff --git a/assets/mac_x64/libopenimsdk.dylib b/assets/mac_x64/libopenimsdk.dylib index 0a74d19..f96d10d 100644 Binary files a/assets/mac_x64/libopenimsdk.dylib and b/assets/mac_x64/libopenimsdk.dylib differ diff --git a/assets/win_x64/libopenimsdk.dll b/assets/win_x64/libopenimsdk.dll index 6e0b4b1..903f457 100644 Binary files a/assets/win_x64/libopenimsdk.dll and b/assets/win_x64/libopenimsdk.dll differ diff --git a/package-lock.json b/package-lock.json index b3cc6a3..d687263 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openim/electron-client-sdk", - "version": "1.1.1", + "version": "1.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openim/electron-client-sdk", - "version": "1.1.1", + "version": "1.1.5", "license": "MIT", "dependencies": { "koffi": "2.8.0", @@ -15,7 +15,7 @@ "devDependencies": { "@commitlint/cli": "^16.2.4", "@commitlint/config-conventional": "^16.2.4", - "@openim/wasm-client-sdk": "^3.8.2-1", + "@openim/wasm-client-sdk": "^3.8.3", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-terser": "^0.4.4", "@types/ffi-napi": "^4.0.10", @@ -43,7 +43,7 @@ "node": ">=12.0" }, "peerDependencies": { - "@openim/wasm-client-sdk": "^3.8.2-1", + "@openim/wasm-client-sdk": "^3.8.3", "electron": ">=12.0.0" } }, @@ -1882,9 +1882,9 @@ } }, "node_modules/@openim/wasm-client-sdk": { - "version": "3.8.2-1", - "resolved": "https://registry.npmjs.org/@openim/wasm-client-sdk/-/wasm-client-sdk-3.8.2-1.tgz", - "integrity": "sha512-ntpmRJrZVzaAM7MbA1BsY1jgeGEJUlyWGH6Yqz5+yjd1qNBL4f7SysiDXYHoizOWNNWCSGzeC8iZPDMRIS0hEw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@openim/wasm-client-sdk/-/wasm-client-sdk-3.8.3.tgz", + "integrity": "sha512-Kly5qibTdPTaIX8SClbzke46X/hl6vjYY8i0iMAqktrNak+Vn80dxMpY9QhIdwqhYA8MU2ffcdJkd9JXm+QK2Q==", "dev": true, "engines": { "node": ">=12.0" diff --git a/package.json b/package.json index e4e9d4e..8a6235d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openim/electron-client-sdk", - "version": "1.1.5", + "version": "3.8.3", "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-1", + "@openim/wasm-client-sdk": "^3.8.3", "@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-1", + "@openim/wasm-client-sdk": "^3.8.3", "electron": ">=12.0.0" } } diff --git a/src/core/index.ts b/src/core/index.ts index ee6edb5..281ae3b 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -941,6 +941,12 @@ class OpenIMSDK 'void', ['baseCallback *', 'str', 'str', 'str', 'int', 'int', 'int'] ); + this.libOpenIMSDK.fetch_surrounding_messages = this.lib.func( + '__stdcall', + 'fetch_surrounding_messages', + 'void', + ['baseCallback *', 'str', 'str'] + ); } }; @@ -1378,6 +1384,7 @@ class OpenIMSDK createFileMessageByURL!: MessageModuleApi['createFileMessageByURL']; getAdvancedHistoryMessageList!: MessageModuleApi['getAdvancedHistoryMessageList']; getAdvancedHistoryMessageListReverse!: MessageModuleApi['getAdvancedHistoryMessageListReverse']; + fetchSurroundingMessages!: MessageModuleApi['fetchSurroundingMessages']; sendMessage!: MessageModuleApi['sendMessage']; sendMessageNotOss!: MessageModuleApi['sendMessageNotOss']; findMessageList!: MessageModuleApi['findMessageList']; diff --git a/src/core/modules/message.ts b/src/core/modules/message.ts index 4033c6a..b215911 100644 --- a/src/core/modules/message.ts +++ b/src/core/modules/message.ts @@ -28,6 +28,7 @@ import { SoundMsgParamsByURL, SendGroupReadReceiptParams, GetGroupMessageReaderParams, + FetchSurroundingParams, } from '@openim/wasm-client-sdk/lib/types/params'; import { VideoMsgByPathParams, @@ -389,6 +390,22 @@ export function setupMessageModule(openIMSDK: OpenIMSDK) { JSON.stringify(params) ); }), + fetchSurroundingMessages: ( + params: FetchSurroundingParams, + opid = uuidV4() + ) => + new Promise>( + (resolve, reject) => { + openIMSDK.libOpenIMSDK.fetch_surrounding_messages( + openIMSDK.baseCallbackWrap<{ messageList: MessageItem[] }>( + resolve, + reject + ), + opid, + JSON.stringify(params) + ); + } + ), findMessageList: (params: FindMessageParams[], opid = uuidV4()) => new Promise>((resolve, reject) => { openIMSDK.libOpenIMSDK.find_message_list( @@ -586,6 +603,10 @@ export interface MessageModuleApi { params: GetAdvancedHistoryMsgParams, opid?: string ) => Promise>; + fetchSurroundingMessages: ( + params: FetchSurroundingParams, + opid?: string + ) => Promise>; findMessageList: ( params: FindMessageParams[], opid?: string diff --git a/src/types/libOpenIMSDK.d.ts b/src/types/libOpenIMSDK.d.ts index 04205b1..d456c32 100644 --- a/src/types/libOpenIMSDK.d.ts +++ b/src/types/libOpenIMSDK.d.ts @@ -233,6 +233,11 @@ declare module 'libOpenIMSDK' { operationID: string, getMessageOptions: string ): void; + fetch_surrounding_messages( + cCallback: CB_S_I_S_S, + operationID: string, + fetchSurroundingMessagesOptions: string + ): void; revoke_message( cCallback: CB_S_I_S_S, operationID: string,