From 2e3756227dbace95edd50fd9753128af00370e4c Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 18 Sep 2024 10:53:33 +0800 Subject: [PATCH] Refactor: Remove unused GetUsersInfoWithCache function (#707) * refactor: fix error handling in SendMessage function * Refactor: Remove unused GetUsersInfoWithCache function * remove unused markfile contents. --- Makefile | 10 ---------- open_im_sdk/user.go | 4 ---- wasm/cmd/main.go | 1 - wasm/wasm_wrapper/wasm_user.go | 5 ----- 4 files changed, 20 deletions(-) diff --git a/Makefile b/Makefile index 8dfc70427..07f5103cf 100644 --- a/Makefile +++ b/Makefile @@ -130,16 +130,6 @@ ifeq ($(origin GOBIN), undefined) GOBIN := $(GOPATH)/bin endif -COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/cmd/*)) -BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd})) - -ifeq (${COMMANDS},) - $(error Could not determine COMMANDS, set ROOT_DIR or run in source dir) -endif -ifeq (${BINS},) - $(error Could not determine BINS, set ROOT_DIR or run in source dir) -endif - EXCLUDE_TESTS=github.com/openimsdk/openim-sdk-core/test # ============================================================================== diff --git a/open_im_sdk/user.go b/open_im_sdk/user.go index b2d05dbec..a3cd6b0e3 100644 --- a/open_im_sdk/user.go +++ b/open_im_sdk/user.go @@ -52,7 +52,3 @@ func GetAllUserCommands(callback open_im_sdk_callback.Base, operationID string, call(callback, operationID, UserForSDK.User().ProcessUserCommandGetAll, Type) } -// GetUsersInfoWithCache gets the user's information with cache. -func GetUsersInfoWithCache(callback open_im_sdk_callback.Base, operationID string, userIDs string) { - call(callback, operationID, UserForSDK.User().GetUsersInfoWithCache, userIDs) -} diff --git a/wasm/cmd/main.go b/wasm/cmd/main.go index 3a77bfa35..08927599f 100644 --- a/wasm/cmd/main.go +++ b/wasm/cmd/main.go @@ -159,7 +159,6 @@ func registerFunc() { js.Global().Set("setSelfInfo", js.FuncOf(wrapperUser.SetSelfInfo)) //js.Global().Set("setSelfInfoEx", js.FuncOf(wrapperUser.SetSelfInfo)) js.Global().Set("getUsersInfo", js.FuncOf(wrapperUser.GetUsersInfo)) - js.Global().Set("getUsersInfoWithCache", js.FuncOf(wrapperUser.GetUsersInfoWithCache)) js.Global().Set("subscribeUsersStatus", js.FuncOf(wrapperUser.SubscribeUsersStatus)) js.Global().Set("unsubscribeUsersStatus", js.FuncOf(wrapperUser.UnsubscribeUsersStatus)) js.Global().Set("getSubscribeUsersStatus", js.FuncOf(wrapperUser.GetSubscribeUsersStatus)) diff --git a/wasm/wasm_wrapper/wasm_user.go b/wasm/wasm_wrapper/wasm_user.go index 70eaf4bb5..6180842cb 100644 --- a/wasm/wasm_wrapper/wasm_user.go +++ b/wasm/wasm_wrapper/wasm_user.go @@ -49,11 +49,6 @@ func (w *WrapperUser) GetUsersInfo(_ js.Value, args []js.Value) interface{} { return event_listener.NewCaller(open_im_sdk.GetUsersInfo, callback, &args).AsyncCallWithCallback() } -func (w *WrapperUser) GetUsersInfoWithCache(_ js.Value, args []js.Value) interface{} { - callback := event_listener.NewBaseCallback(utils.FirstLower(utils.GetSelfFuncName()), w.commonFunc) - return event_listener.NewCaller(open_im_sdk.GetUsersInfoWithCache, callback, &args).AsyncCallWithCallback() -} - func (w *WrapperUser) SubscribeUsersStatus(_ js.Value, args []js.Value) interface{} { callback := event_listener.NewBaseCallback(utils.FirstLower(utils.GetSelfFuncName()), w.commonFunc) return event_listener.NewCaller(open_im_sdk.SubscribeUsersStatus, callback, &args).AsyncCallWithCallback()