Skip to content

Commit

Permalink
Add set ex friend, conversation, and userinfo. Add search conversation (
Browse files Browse the repository at this point in the history
#442)

* add pin friend

* Delete open-im-sdk-core.2023-11-28

* update time for usercommand

* update name JSON to friendIDsAndIsPinned

* Update go.mod

* remove bug

* fix pin friend js

* change pin friend name and fix bugs

* change pin friend name and fix bugs

* change pin friend name and fix bugs

* fix bugs

* add updateUserInfoEx

* deprecated updateUserInfo

* add ex for friend

* update ex

* update ex

* fix test

* fix go mod

* fix go mod

* fix go mod

* search conversation, fix some name bugs

* add search conversation js

* update data transfer bug

* update data transfer bug

* update data transfer bug

* update data transfer bug
  • Loading branch information
AndrewZuo01 authored Dec 25, 2023
1 parent aab4a45 commit 86c74af
Show file tree
Hide file tree
Showing 36 changed files with 253 additions and 81 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
require golang.org/x/net v0.19.0

require (
github.com/OpenIMSDK/protocol v0.0.34
github.com/OpenIMSDK/protocol v0.0.37
github.com/OpenIMSDK/tools v0.0.5
github.com/google/go-cmp v0.5.9
golang.org/x/image v0.14.0
Expand All @@ -44,3 +44,5 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 // indirect
google.golang.org/grpc v1.56.2 // indirect
)

replace github.com/OpenIMSDK/protocol v0.0.34 => github.com/AndrewZuo01/protocol v0.0.0-20231220082114-c2129ec584bc
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/OpenIMSDK/protocol v0.0.34 h1:dK+Y5h10s/S8dcj/jXrRzmEAdKvoDRhw+ASLACh2FYY=
github.com/OpenIMSDK/protocol v0.0.34/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
github.com/OpenIMSDK/protocol v0.0.37 h1:sVTnb3TjMQ3PG4m3gDI/LAM1Hkk9nI6gf7lf7UpscnI=
github.com/OpenIMSDK/protocol v0.0.37/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y=
github.com/OpenIMSDK/tools v0.0.5 h1:yBVHJ3EpIDcp8VFKPjuGr6MQvFa3t4JByZ+vmeC06/Q=
github.com/OpenIMSDK/tools v0.0.5/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI=
github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ=
Expand Down
Empty file added identifier.sqlite
Empty file.
6 changes: 5 additions & 1 deletion internal/conversation_msg/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ func (c *Conversation) SetOneConversationBurnDuration(ctx context.Context, conve
func (c *Conversation) SetOneConversationRecvMessageOpt(ctx context.Context, conversationID string, opt int) error {
return c.setConversationAndSync(ctx, conversationID, &pbConversation.ConversationReq{RecvMsgOpt: &wrapperspb.Int32Value{Value: int32(opt)}})
}

func (c *Conversation) SetOneConversationEx(ctx context.Context, conversationID string, ex string) error {
return c.setConversationAndSync(ctx, conversationID, &pbConversation.ConversationReq{Ex: &wrapperspb.StringValue{
Value: ex,
}})
}
func (c *Conversation) GetTotalUnreadMsgCount(ctx context.Context) (totalUnreadCount int32, err error) {
return c.db.GetTotalUnreadMsgCountDB(ctx)
}
Expand Down
4 changes: 3 additions & 1 deletion internal/friend/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ func (f *Friend) doNotification(ctx context.Context, msg *sdkws.MsgData) error {
return f.SyncAllBlackList(ctx)
}
case constant.FriendPinSetNotifiaction:
var tips sdkws.PinFriendTips

var tips sdkws.UpdateFriendTips

if err := utils.UnmarshalNotificationElem(msg.Content, &tips); err != nil {
return err
}
Expand Down
48 changes: 45 additions & 3 deletions internal/friend/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package friend

import (
"context"
"github.com/OpenIMSDK/protocol/wrapperspb"
"github.com/OpenIMSDK/tools/errs"
"github.com/openimsdk/openim-sdk-core/v3/internal/util"
"github.com/openimsdk/openim-sdk-core/v3/pkg/constant"
"github.com/openimsdk/openim-sdk-core/v3/pkg/db/model_struct"
Expand Down Expand Up @@ -226,13 +228,13 @@ func (f *Friend) SetFriendRemark(ctx context.Context, userIDRemark *sdk.SetFrien
}

func (f *Friend) PinFriends(ctx context.Context, userIDPin *sdk.SetFriendPinParams) error {
if err := util.ApiPost(ctx, constant.SetFriendPin, &friend.PinFriendsReq{OwnerUserID: f.loginUserID, FriendUserIDs: userIDPin.ToUserIDs, IsPinned: userIDPin.IsPinned}, nil); err != nil {
if err := util.ApiPost(ctx, constant.UpdateFriends, &friend.UpdateFriendsReq{OwnerUserID: f.loginUserID, FriendUserIDs: userIDPin.ToUserIDs, IsPinned: userIDPin.IsPinned}, nil); err != nil {
return err
}
return f.SyncFriends(ctx, userIDPin.ToUserIDs)
}
func (f *Friend) AddBlack(ctx context.Context, blackUserID string) error {
if err := util.ApiPost(ctx, constant.AddBlackRouter, &friend.AddBlackReq{OwnerUserID: f.loginUserID, BlackUserID: blackUserID}, nil); err != nil {
func (f *Friend) AddBlack(ctx context.Context, blackUserID string, ex string) error {
if err := util.ApiPost(ctx, constant.AddBlackRouter, &friend.AddBlackReq{OwnerUserID: f.loginUserID, BlackUserID: blackUserID, Ex: ex}, nil); err != nil {
return err
}
return f.SyncAllBlackList(ctx)
Expand All @@ -248,3 +250,43 @@ func (f *Friend) RemoveBlack(ctx context.Context, blackUserID string) error {
func (f *Friend) GetBlackList(ctx context.Context) ([]*model_struct.LocalBlack, error) {
return f.db.GetBlackListDB(ctx)
}
func (f *Friend) SetFriendsEx(ctx context.Context, friendIDs []string, ex string) error {
if err := util.ApiPost(ctx, constant.UpdateFriends, &friend.UpdateFriendsReq{OwnerUserID: f.loginUserID, FriendUserIDs: friendIDs, Ex: &wrapperspb.StringValue{
Value: ex,
}}, nil); err != nil {
return err
}
// Check if the specified ID is a friend
friendResults, err := f.CheckFriend(ctx, friendIDs)
if err != nil {
return errs.Wrap(err, "Error checking friend status")
}

// Determine if friendID is indeed a friend
// Iterate over each friendID
for _, friendID := range friendIDs {
isFriend := false

// Check if this friendID is in the friendResults
for _, result := range friendResults {
if result.UserID == friendID && result.Result == 1 { // Assuming result 1 means they are friends
isFriend = true
break
}
}

// If this friendID is not a friend, return an error
if !isFriend {
return errs.ErrRecordNotFound.Wrap("Not friend")
}
}

// If the code reaches here, all friendIDs are confirmed as friends
// Update friend information if they are friends

updateErr := f.db.UpdateColumnsFriend(ctx, friendIDs, map[string]interface{}{"Ex": ex})
if updateErr != nil {
return errs.Wrap(updateErr, "Error updating friend information")
}
return nil
}
4 changes: 2 additions & 2 deletions internal/group/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func (g *Group) CreateGroup(ctx context.Context, req *group.CreateGroupReq) (*sd
return resp.GroupInfo, nil
}

func (g *Group) JoinGroup(ctx context.Context, groupID, reqMsg string, joinSource int32) error {
if err := util.ApiPost(ctx, constant.JoinGroupRouter, &group.JoinGroupReq{GroupID: groupID, ReqMessage: reqMsg, JoinSource: joinSource, InviterUserID: g.loginUserID}, nil); err != nil {
func (g *Group) JoinGroup(ctx context.Context, groupID, reqMsg string, joinSource int32, ex string) error {
if err := util.ApiPost(ctx, constant.JoinGroupRouter, &group.JoinGroupReq{GroupID: groupID, ReqMessage: reqMsg, JoinSource: joinSource, InviterUserID: g.loginUserID, Ex: ex}, nil); err != nil {
return err
}
if err := g.SyncSelfGroupApplications(ctx, groupID); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions internal/user/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ func (u *User) GetSelfUserInfo(ctx context.Context) (*model_struct.LocalUser, er
return u.getSelfUserInfo(ctx)
}

// Deprecated: user SetSelfInfoEx instead
func (u *User) SetSelfInfo(ctx context.Context, userInfo *sdkws.UserInfo) error {
return u.updateSelfUserInfo(ctx, userInfo)
}
func (u *User) SetSelfInfoEx(ctx context.Context, userInfo *sdkws.UserInfoWithEx) error {
return u.updateSelfUserInfoEx(ctx, userInfo)
}
func (u *User) SetGlobalRecvMessageOpt(ctx context.Context, opt int) error {
if err := util.ApiPost(ctx, constant.SetGlobalRecvMessageOptRouter,
&pbUser.SetGlobalRecvMessageOptReq{UserID: u.loginUserID, GlobalRecvMsgOpt: int32(opt)}, nil); err != nil {
Expand Down
10 changes: 10 additions & 0 deletions internal/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ func (u *User) updateSelfUserInfo(ctx context.Context, userInfo *sdkws.UserInfo)
return nil
}

// updateSelfUserInfoEx updates the user's information with Ex field.
func (u *User) updateSelfUserInfoEx(ctx context.Context, userInfo *sdkws.UserInfoWithEx) error {
userInfo.UserID = u.loginUserID
if err := util.ApiPost(ctx, constant.UpdateSelfUserInfoExRouter, userPb.UpdateUserInfoExReq{UserInfo: userInfo}, nil); err != nil {
return err
}
_ = u.SyncLoginUserInfo(ctx)
return nil
}

// CRUD user command
//func (u *User) ProcessUserCommandAdd(ctx context.Context, userCommand *sdkws.ProcessUserCommand) error {
// if err := util.ApiPost(ctx, constant.ProcessUserCommandAdd, userPb.ProcessUserCommandAddReq{UserID: u.loginUserID, Type: userCommand.Type, Uuid: userCommand.Uuid, Value: userCommand.Value}, nil); err != nil {
Expand Down
4 changes: 3 additions & 1 deletion open_im_sdk/conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func SetConversationMsgDestructTime(callback open_im_sdk_callback.Base, operatio
func SetConversationIsMsgDestruct(callback open_im_sdk_callback.Base, operationID string, conversationID string, isMsgDestruct bool) {
call(callback, operationID, UserForSDK.Conversation().SetConversationIsMsgDestruct, conversationID, isMsgDestruct)
}

func SetConversationEx(callback open_im_sdk_callback.Base, operationID string, conversationID string, ex string) {
call(callback, operationID, UserForSDK.Conversation().SetOneConversationEx, conversationID, ex)
}
func HideConversation(callback open_im_sdk_callback.Base, operationID string, conversationID string) {
call(callback, operationID, UserForSDK.Conversation().HideConversation, conversationID)
}
Expand Down
4 changes: 0 additions & 4 deletions open_im_sdk/em.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ func (e *emptyFriendshipListener) OnBlackDeleted(blackInfo string) {
log.ZWarn(e.ctx, "FriendshipListener is not implemented", nil,
"blackInfo", blackInfo)
}
func (e *emptyFriendshipListener) OnPinFriends(friendInfo string) {
log.ZWarn(e.ctx, "FriendshipListener is not implemented", nil,
"friendInfo", friendInfo)
}

type emptyConversationListener struct {
ctx context.Context
Expand Down
11 changes: 7 additions & 4 deletions open_im_sdk/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func AddFriend(callback open_im_sdk_callback.Base, operationID string, userIDReq
func SetFriendRemark(callback open_im_sdk_callback.Base, operationID string, userIDRemark string) {
call(callback, operationID, UserForSDK.Friend().SetFriendRemark, userIDRemark)
}
func PinFriends(callback open_im_sdk_callback.Base, operationID string, friendIDsAndIsPinned string) {
call(callback, operationID, UserForSDK.Friend().PinFriends, friendIDsAndIsPinned)
func PinFriends(callback open_im_sdk_callback.Base, operationID string, setFriendPinParams string) {
call(callback, operationID, UserForSDK.Friend().PinFriends, setFriendPinParams)
}
func DeleteFriend(callback open_im_sdk_callback.Base, operationID string, friendUserID string) {
call(callback, operationID, UserForSDK.Friend().DeleteFriend, friendUserID)
Expand All @@ -66,8 +66,8 @@ func RefuseFriendApplication(callback open_im_sdk_callback.Base, operationID str
call(callback, operationID, UserForSDK.Friend().RefuseFriendApplication, userIDHandleMsg)
}

func AddBlack(callback open_im_sdk_callback.Base, operationID string, blackUserID string) {
call(callback, operationID, UserForSDK.Friend().AddBlack, blackUserID)
func AddBlack(callback open_im_sdk_callback.Base, operationID string, blackUserID string, ex string) {
call(callback, operationID, UserForSDK.Friend().AddBlack, blackUserID, ex)
}

func GetBlackList(callback open_im_sdk_callback.Base, operationID string) {
Expand All @@ -77,3 +77,6 @@ func GetBlackList(callback open_im_sdk_callback.Base, operationID string) {
func RemoveBlack(callback open_im_sdk_callback.Base, operationID string, removeUserID string) {
call(callback, operationID, UserForSDK.Friend().RemoveBlack, removeUserID)
}
func SetFriendsEx(callback open_im_sdk_callback.Base, operationID string, friendIDs string, ex string) {
call(callback, operationID, UserForSDK.Friend().SetFriendsEx, friendIDs, ex)
}
4 changes: 2 additions & 2 deletions open_im_sdk/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func CreateGroup(callback open_im_sdk_callback.Base, operationID string, groupRe
call(callback, operationID, UserForSDK.Group().CreateGroup, groupReqInfo)
}

func JoinGroup(callback open_im_sdk_callback.Base, operationID string, groupID string, reqMsg string, joinSource int32) {
call(callback, operationID, UserForSDK.Group().JoinGroup, groupID, reqMsg, joinSource)
func JoinGroup(callback open_im_sdk_callback.Base, operationID string, groupID string, reqMsg string, joinSource int32, ex string) {
call(callback, operationID, UserForSDK.Group().JoinGroup, groupID, reqMsg, joinSource, ex)
}

func QuitGroup(callback open_im_sdk_callback.Base, operationID string, groupID string) {
Expand Down
6 changes: 6 additions & 0 deletions open_im_sdk/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ func GetUsersInfoFromSrv(callback open_im_sdk_callback.Base, operationID string,
}

// SetSelfInfo sets the user's own information.
// Deprecated: user SetSelfInfoEx instead
func SetSelfInfo(callback open_im_sdk_callback.Base, operationID string, userInfo string) {
call(callback, operationID, UserForSDK.User().SetSelfInfo, userInfo)
}

// SetSelfInfoEx sets the user's own information with Ex field.
func SetSelfInfoEx(callback open_im_sdk_callback.Base, operationID string, userInfo string) {
call(callback, operationID, UserForSDK.User().SetSelfInfoEx, userInfo)
}
func SetGlobalRecvMessageOpt(callback open_im_sdk_callback.Base, operationID string, opt int) {
call(callback, operationID, UserForSDK.User().SetGlobalRecvMessageOpt, opt)
}
Expand Down
1 change: 0 additions & 1 deletion open_im_sdk_callback/callback_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ type OnFriendshipListener interface {
OnFriendInfoChanged(friendInfo string)
OnBlackAdded(blackInfo string)
OnBlackDeleted(blackInfo string)
OnPinFriends(friendInfo string)
}
type OnConversationListener interface {
OnSyncServerStart()
Expand Down
5 changes: 0 additions & 5 deletions open_im_sdk_callback/callback_go_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type OnFriendshipListenerSdk interface {
OnFriendInfoChanged(friendInfo model_struct.LocalFriend)
OnBlackAdded(blackInfo model_struct.LocalBlack)
OnBlackDeleted(blackInfo model_struct.LocalBlack)
OnPinFriends(friendInfo model_struct.LocalFriend)
}

type onFriendshipListener struct {
Expand Down Expand Up @@ -87,7 +86,3 @@ func (o *onFriendshipListener) OnBlackDeleted(blackInfo model_struct.LocalBlack)
log.ZDebug(context.Background(), "OnBlackDeleted", "blackInfo", blackInfo)
o.onFriendshipListener().OnBlackDeleted(utils.StructToJsonString(blackInfo))
}
func (o *onFriendshipListener) OnPinFriends(friendInfo model_struct.LocalFriend) {
log.ZDebug(context.Background(), "OnPinFriends", "friendPin", friendInfo)
o.onFriendshipListener().OnPinFriends(utils.StructToJsonString(friendInfo))
}
3 changes: 2 additions & 1 deletion pkg/constant/server_api_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
GetSelfUserInfoRouter = "/user/get_self_user_info"
GetUsersInfoRouter = "/user/get_users_info"
UpdateSelfUserInfoRouter = "/user/update_user_info"
UpdateSelfUserInfoExRouter = "/user/update_user_info_ex"
SetGlobalRecvMessageOptRouter = "/user/set_global_msg_recv_opt"
ProcessUserCommandAdd = "/process_user_command_add"
ProcessUserCommandDelete = "/process_user_command_delete"
Expand All @@ -42,7 +43,7 @@ const (
GetDesignatedFriendsRouter = "/friend/get_designated_friends"
AddFriendResponse = "/friend/add_friend_response"
SetFriendRemark = "/friend/set_friend_remark"
SetFriendPin = "/friend/set_pin_friend"
UpdateFriends = "/friend/update_friends"

AddBlackRouter = "/friend/add_black"
RemoveBlackRouter = "/friend/remove_black"
Expand Down
4 changes: 2 additions & 2 deletions pkg/db/conversation_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ func (d *DataBase) DecrConversationUnreadCount(ctx context.Context, conversation
}
func (d *DataBase) SearchConversations(ctx context.Context, searchParam string) ([]*model_struct.LocalConversation, error) {
// Define the search condition based on the searchParam
condition := fmt.Sprintf("showname like %q ", "%"+searchParam+"%")
condition := fmt.Sprintf("show_name like %q ", "%"+searchParam+"%")

var conversationList []model_struct.LocalConversation
err := d.conn.WithContext(ctx).Where(condition).Order("create_time DESC").Find(&conversationList).Error
err := d.conn.WithContext(ctx).Where(condition).Order("latest_msg_send_time DESC").Find(&conversationList).Error
var transfer []*model_struct.LocalConversation
for _, v := range conversationList {
v1 := v // Create a copy to avoid referencing the loop variable
Expand Down
1 change: 1 addition & 0 deletions pkg/db/db_interface/databse.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ type FriendModel interface {
GetSendFriendApplication(ctx context.Context) ([]*model_struct.LocalFriendRequest, error)
GetFriendApplicationByBothID(ctx context.Context, fromUserID, toUserID string) (*model_struct.LocalFriendRequest, error)
GetBothFriendReq(ctx context.Context, fromUserID, toUserID string) ([]*model_struct.LocalFriendRequest, error)
UpdateColumnsFriend(ctx context.Context, friendIDs []string, args map[string]interface{}) error

GetBlackListDB(ctx context.Context) ([]*model_struct.LocalBlack, error)
GetBlackListUserID(ctx context.Context) (blackListUid []string, err error)
Expand Down
6 changes: 0 additions & 6 deletions pkg/db/db_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package db
import (
"context"
"errors"
"github.com/openimsdk/openim-sdk-core/v3/pkg/db/model_struct"
"github.com/openimsdk/openim-sdk-core/v3/wasm/exec"
"github.com/openimsdk/openim-sdk-core/v3/wasm/indexdb"
)
Expand Down Expand Up @@ -46,11 +45,6 @@ type IndexDB struct {
loginUserID string
}

func (i IndexDB) SearchConversations(ctx context.Context, searchParam string) ([]*model_struct.LocalConversation, error) {
//TODO implement me
panic("implement me")
}

func (i IndexDB) Close(ctx context.Context) error {
_, err := exec.Exec()
return err
Expand Down
9 changes: 9 additions & 0 deletions pkg/db/friend_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,12 @@ func (d *DataBase) GetFriendInfoList(ctx context.Context, friendUserIDList []str
}
return transfer, err
}
func (d *DataBase) UpdateColumnsFriend(ctx context.Context, friendIDs []string, args map[string]interface{}) error {
d.mRWMutex.Lock()
defer d.mRWMutex.Unlock()

// Update records where FriendUserID is in the friendIDs slice
t := d.conn.WithContext(ctx).Model(&model_struct.LocalFriend{}).Where("friend_user_id IN ?", friendIDs).Updates(args)

return utils.Wrap(t.Error, "UpdateColumnsFriend failed")
}
5 changes: 1 addition & 4 deletions test/t_friend_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (t testAddToBlackList) OnError(code int32, msg string) {
func DoTestAddToBlackList(userID string) {
var test testAddToBlackList
test.OperationID = utils.OperationIDGenerator()
open_im_sdk.AddBlack(test, test.OperationID, userID)
open_im_sdk.AddBlack(test, test.OperationID, userID, "")
}

// /////////////////////////////////////////////////////
Expand Down Expand Up @@ -755,9 +755,6 @@ func (testFriendListener) OnBlackDeleted(callbackInfo string) {
func (testFriendListener) OnFriendInfoChanged(callbackInfo string) {
log.Info(utils.OperationIDGenerator(), utils.GetSelfFuncName(), callbackInfo)
}
func (testFriendListener) OnPinFriends(callbackInfo string) {
log.Info(utils.OperationIDGenerator(), utils.GetSelfFuncName(), callbackInfo)
}

func (testFriendListener) OnSuccess() {
log.Info(utils.OperationIDGenerator(), utils.GetSelfFuncName())
Expand Down
5 changes: 3 additions & 2 deletions test/t_group_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ func DoTestJoinGroup() {
test.OperationID = utils.OperationIDGenerator()
groupID := "1003105543"
reqMsg := "121212"
log.Info(test.OperationID, "test join group input", groupID, reqMsg)
open_im_sdk.JoinGroup(test, test.OperationID, groupID, reqMsg, constant.JoinBySearch)
ex := "ex"
log.Info(test.OperationID, "test join group input", groupID, reqMsg, ex)
open_im_sdk.JoinGroup(test, test.OperationID, groupID, reqMsg, constant.JoinBySearch, ex)
}

type testQuitGroup struct {
Expand Down
19 changes: 2 additions & 17 deletions testv2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,10 @@ import (
)

const (
//APIADDR = "http://43.154.157.177:10002"
//WSADDR = "ws://43.154.157.177:10001"
//UserID = "kernaltestuid2"

//APIADDR = "http://59.36.173.89:10002"
APIADDR = "http://14.29.168.56:10002"
//WSADDR = "ws://59.36.173.89:10001"
WSADDR = "ws://14.29.168.56:10001"
//UserID = "2688118337"
//UserID = "7204255074"
APIADDR = "http://14.29.168.56:10002"
WSADDR = "ws://14.29.168.56:10001"
UserID = "1"
friendUserID = "3281432310"
// APIADDR = "http://192.168.44.128:10002"
// WSADDR = "ws://192.168.44.128:10001"
// UserID = "100"

//APIADDR = "http://59.36.173.89:10002"
//WSADDR = "ws://59.36.173.89:10001"
//UserID = "kernaltestuid9"
)

func getConf(APIADDR, WSADDR string) sdk_struct.IMConfig {
Expand Down
Loading

0 comments on commit 86c74af

Please sign in to comment.