Skip to content

Commit

Permalink
feat: add SearchConversation WASM (#724)
Browse files Browse the repository at this point in the history
* feat: add SearchConversation WASM

* feat: add SearchConversation WASM

* feat: change log
  • Loading branch information
icey-yu authored Sep 27, 2024
1 parent c661189 commit aa37216
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/conversation_msg/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *Conversation) doNotificationManager(c2v common.Cmd2Value) {
func (c *Conversation) DoNotification(ctx context.Context, msg *sdkws.MsgData) {
go func() {
if err := c.doNotification(ctx, msg); err != nil {
log.ZWarn(ctx, "DoGroupNotification failed", err)
log.ZWarn(ctx, "DoConversationNotification failed", err)
}
}()
}
Expand Down
1 change: 1 addition & 0 deletions wasm/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func registerFunc() {
js.Global().Set("insertGroupMessageToLocalStorage", js.FuncOf(wrapperConMsg.InsertGroupMessageToLocalStorage))
js.Global().Set("searchLocalMessages", js.FuncOf(wrapperConMsg.SearchLocalMessages))
js.Global().Set("setMessageLocalEx", js.FuncOf(wrapperConMsg.SetMessageLocalEx))
js.Global().Set("searchConversation", js.FuncOf(wrapperConMsg.SearchConversation))

js.Global().Set("changeInputStates", js.FuncOf(wrapperConMsg.ChangeInputStates))
js.Global().Set("getInputStates", js.FuncOf(wrapperConMsg.GetInputStates))
Expand Down
5 changes: 5 additions & 0 deletions wasm/wasm_wrapper/wasm_conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ func (w *WrapperConMsg) SetMessageLocalEx(_ js.Value, args []js.Value) interface
return event_listener.NewCaller(open_im_sdk.SetMessageLocalEx, callback, &args).AsyncCallWithCallback()
}

func (w *WrapperConMsg) SearchConversation(_ js.Value, args []js.Value) interface{} {
callback := event_listener.NewBaseCallback(utils.FirstLower(utils.GetSelfFuncName()), w.commonFunc)
return event_listener.NewCaller(open_im_sdk.SearchConversation, callback, &args).AsyncCallWithCallback()
}

func (w *WrapperConMsg) DeleteConversationAndDeleteAllMsg(_ js.Value, args []js.Value) interface{} {
callback := event_listener.NewBaseCallback(utils.FirstLower(utils.GetSelfFuncName()), w.commonFunc)
return event_listener.NewCaller(open_im_sdk.DeleteConversationAndDeleteAllMsg, callback, &args).AsyncCallWithCallback()
Expand Down

0 comments on commit aa37216

Please sign in to comment.