From 26d71a7c65040940e12b11a72338b9b3bdffb80e Mon Sep 17 00:00:00 2001 From: yejian <596306006@qq.com> Date: Tue, 8 Oct 2024 22:25:17 +0800 Subject: [PATCH] update sdk to 3.8.1 --- .gitignore | 1 + export.go | 197 +++++++++++++++-------------------------------------- go.mod | 39 +++++------ go.sum | 80 +++++++++++----------- message.go | 6 ++ 5 files changed, 120 insertions(+), 203 deletions(-) diff --git a/.gitignore b/.gitignore index 2934a0e..df0c0a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.o *.obj +*.h *.gch *.pch *.so diff --git a/export.go b/export.go index 70f0f8f..962a23d 100644 --- a/export.go +++ b/export.go @@ -66,21 +66,21 @@ func NewConnCallback() *ConnCallback { func (c ConnCallback) OnConnecting() { DispatorMsg(Msg_Connecting, Empty{}) } - func (c ConnCallback) OnConnectSuccess() { DispatorMsg(Msg_ConnectSuccess, Empty{}) } - func (c ConnCallback) OnConnectFailed(errCode int32, errMsg string) { DispatorMsg(Msg_ConnectFailed, Error{ErrCode: errCode, ErrMsg: errMsg}) } - func (c ConnCallback) OnKickedOffline() { DispatorMsg(Msg_KickedOffline, Empty{}) } func (c ConnCallback) OnUserTokenExpired() { DispatorMsg(Msg_UserTokenExpired, Empty{}) } +func (c ConnCallback) OnUserTokenInvalid(errMsg string) { + DispatorMsg(Msg_UserTokenInvalid, Error{ErrCode: 0, ErrMsg: errMsg}) +} type ConversationCallback struct { } @@ -88,14 +88,29 @@ type ConversationCallback struct { func NewConversationCallback() *ConversationCallback { return &ConversationCallback{} } -func (c ConversationCallback) OnSyncServerStart() { - DispatorMsg(Msg_SyncServerStart, Empty{}) -} -func (c ConversationCallback) OnSyncServerFinish() { - DispatorMsg(Msg_SyncServerFinish, Empty{}) -} -func (c ConversationCallback) OnSyncServerFailed() { - DispatorMsg(Msg_SyncServerFailed, Empty{}) +func (c ConversationCallback) OnSyncServerStart(reinstalled bool) { + DispatorMsg(Msg_SyncServerStart, struct { + Reinstalled bool `json:"reinstalled"` + }{ + Reinstalled: reinstalled, + }) +} +func (c ConversationCallback) OnSyncServerFinish(reinstalled bool) { + DispatorMsg(Msg_SyncServerFinish, struct { + Reinstalled bool `json:"reinstalled"` + }{ + Reinstalled: reinstalled, + }) +} +func (c ConversationCallback) OnSyncServerProgress(progress int) { + DispatorMsg(Msg_SyncServerProgress, Progress{Progress: progress}) +} +func (c ConversationCallback) OnSyncServerFailed(reinstalled bool) { + DispatorMsg(Msg_SyncServerFailed, struct { + Reinstalled bool `json:"reinstalled"` + }{ + Reinstalled: reinstalled, + }) } func (c ConversationCallback) OnNewConversation(conversationList string) { DispatorMsg(Msg_NewConversation, conversationList) @@ -253,11 +268,18 @@ type UserCallback struct { func (u UserCallback) OnSelfInfoUpdated(userInfo string) { DispatorMsg(Msg_SelfInfoUpdated, userInfo) } - func (u UserCallback) OnUserStatusChanged(statusMap string) { DispatorMsg(Msg_UserStatusChanged, statusMap) } - +func (u UserCallback) OnUserCommandAdd(userCommand string) { + DispatorMsg(Msg_UserCommandAdd, userCommand) +} +func (u UserCallback) OnUserCommandDelete(userCommand string) { + DispatorMsg(Msg_UserCommandDelete, userCommand) +} +func (u UserCallback) OnUserCommandUpdate(userCommand string) { + DispatorMsg(Msg_UserCommandUpdate, userCommand) +} func NewUserCallback() *UserCallback { return &UserCallback{} } @@ -510,28 +532,16 @@ func get_multiple_conversation(operationID *C.char, conversationIDList *C.char) open_im_sdk.GetMultipleConversation(baseCallback, C.GoString(operationID), C.GoString(conversationIDList)) } -//export set_conversation_msg_destruct_time -func set_conversation_msg_destruct_time(operationID *C.char, conversationID *C.char, msgDestructTime C.longlong) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetConversationMsgDestructTime(baseCallback, C.GoString(operationID), C.GoString(conversationID), int64(msgDestructTime)) -} - -//export set_conversation_is_msg_destruct -func set_conversation_is_msg_destruct(operationID *C.char, conversationID *C.char, isMsgDestruct C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetConversationIsMsgDestruct(baseCallback, C.GoString(operationID), C.GoString(conversationID), parseBool(int(isMsgDestruct))) -} - //export hide_conversation func hide_conversation(operationID *C.char, conversationID *C.char) { baseCallback := NewBaseCallback(operationID, DataType_Empty) open_im_sdk.HideConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID)) } -//export get_conversation_recv_message_opt -func get_conversation_recv_message_opt(operationID *C.char, conversationIDList *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_GetConversationRecvMessageOptResp_List) - open_im_sdk.GetConversationRecvMessageOpt(baseCallback, C.GoString(operationID), C.GoString(conversationIDList)) +//export set_conversation +func set_conversation(operationID *C.char, conversationID, req *C.char) { + baseCallback := NewBaseCallback(operationID, DataType_Empty) + open_im_sdk.SetConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID), C.GoString(req)) } //export set_conversation_draft @@ -540,37 +550,6 @@ func set_conversation_draft(operationID *C.char, conversationID *C.char, draftTe open_im_sdk.SetConversationDraft(baseCallback, C.GoString(operationID), C.GoString(conversationID), C.GoString(draftText)) } -//export reset_conversation_group_at_type -func reset_conversation_group_at_type(operationID *C.char, conversationID *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.ResetConversationGroupAtType(baseCallback, C.GoString(operationID), C.GoString(conversationID)) -} - -//export pin_conversation -func pin_conversation(operationID *C.char, conversationID *C.char, isPinned C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.PinConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID), parseBool(int(isPinned))) -} - -//export set_conversation_private_chat -func set_conversation_private_chat(operationID *C.char, conversationID *C.char, isPrivate C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetConversationPrivateChat(baseCallback, C.GoString(operationID), C.GoString(conversationID), - parseBool(int(isPrivate))) -} - -//export set_conversation_burn_duration -func set_conversation_burn_duration(operationID *C.char, conversationID *C.char, duration C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetConversationBurnDuration(baseCallback, C.GoString(operationID), C.GoString(conversationID), int32(duration)) -} - -//export set_conversation_recv_message_opt -func set_conversation_recv_message_opt(operationID *C.char, conversationID *C.char, opt C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetConversationRecvMessageOpt(baseCallback, C.GoString(operationID), C.GoString(conversationID), int(opt)) -} - //export get_total_unread_msg_count func get_total_unread_msg_count(operationID *C.char) { baseCallback := NewBaseCallback(operationID, DataType_Int) @@ -588,17 +567,17 @@ func get_conversation_id_by_session_type(operationID *C.char, sourceID *C.char, } //export send_message -func send_message(operationID, message, recvID, groupID, offlinePushInfo *C.char) { +func send_message(operationID, message, recvID, groupID, offlinePushInfo *C.char, isOnlineOnly C.int) { sendMsgCallback := NewSendMessageCallback(operationID) open_im_sdk.SendMessage(sendMsgCallback, C.GoString(operationID), C.GoString(message), C.GoString(recvID), - C.GoString(groupID), C.GoString(offlinePushInfo)) + C.GoString(groupID), C.GoString(offlinePushInfo), parseBool(int(isOnlineOnly))) } //export send_message_not_oss -func send_message_not_oss(operationID, message, recvID, groupID, offlinePushInfo *C.char) { +func send_message_not_oss(operationID, message, recvID, groupID, offlinePushInfo *C.char, isOnlineOnly C.int) { sendMsgCallback := NewSendMessageCallback(operationID) open_im_sdk.SendMessageNotOss(sendMsgCallback, C.GoString(operationID), C.GoString(message), C.GoString(recvID), - C.GoString(groupID), C.GoString(offlinePushInfo)) + C.GoString(groupID), C.GoString(offlinePushInfo), parseBool(int(isOnlineOnly))) } //export find_message_list @@ -711,42 +690,18 @@ func get_users_info(operationID *C.char, userIDs *C.char) { open_im_sdk.GetUsersInfo(baseCallback, C.GoString(operationID), C.GoString(userIDs)) } -//export get_users_info_with_cache -func get_users_info_with_cache(operationID *C.char, userIDs *C.char, groupID *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_FullUserInfoWithCache_List) - open_im_sdk.GetUsersInfoWithCache(baseCallback, C.GoString(operationID), C.GoString(userIDs), C.GoString(groupID)) -} - -//export get_users_info_from_srv -func get_users_info_from_srv(operationID *C.char, userIDs *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_LocalUser_List) - open_im_sdk.GetUsersInfoFromSrv(baseCallback, C.GoString(operationID), C.GoString(userIDs)) -} - //export set_self_info func set_self_info(operationID *C.char, userInfo *C.char) { baseCallback := NewBaseCallback(operationID, DataType_Empty) open_im_sdk.SetSelfInfo(baseCallback, C.GoString(operationID), C.GoString(userInfo)) } -//export set_global_recv_message_opt -func set_global_recv_message_opt(operationID *C.char, opt C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGlobalRecvMessageOpt(baseCallback, C.GoString(operationID), int(opt)) -} - //export get_self_user_info func get_self_user_info(operationID *C.char) { baseCallback := NewBaseCallback(operationID, DataType_LocalUser) open_im_sdk.GetSelfUserInfo(baseCallback, C.GoString(operationID)) } -//export update_msg_sender_info -func update_msg_sender_info(operationID *C.char, nickname *C.char, faceURL *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.UpdateMsgSenderInfo(baseCallback, C.GoString(operationID), C.GoString(nickname), C.GoString(faceURL)) -} - //export subscribe_users_status func subscribe_users_status(operationID *C.char, userIDs *C.char) { baseCallback := NewBaseCallback(operationID, DataType_OnlineStatus_List) @@ -774,21 +729,21 @@ func get_user_status(operationID *C.char, userIDs *C.char) { // =====================================================friend=============================================== // //export get_specified_friends_info -func get_specified_friends_info(operationID *C.char, userIDList *C.char) { +func get_specified_friends_info(operationID *C.char, userIDList *C.char, filterBlack C.int) { baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List) - open_im_sdk.GetSpecifiedFriendsInfo(baseCallback, C.GoString(operationID), C.GoString(userIDList)) + open_im_sdk.GetSpecifiedFriendsInfo(baseCallback, C.GoString(operationID), C.GoString(userIDList), parseBool(int(filterBlack))) } //export get_friend_list -func get_friend_list(operationID *C.char) { +func get_friend_list(operationID *C.char, filterBlack C.int) { baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List) - open_im_sdk.GetFriendList(baseCallback, C.GoString(operationID)) + open_im_sdk.GetFriendList(baseCallback, C.GoString(operationID), parseBool(int(filterBlack))) } //export get_friend_list_page -func get_friend_list_page(operationID *C.char, offset C.int, count C.int) { +func get_friend_list_page(operationID *C.char, offset C.int, count C.int, filterBlack C.int) { baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List) - open_im_sdk.GetFriendListPage(baseCallback, C.GoString(operationID), int32(offset), int32(count)) + open_im_sdk.GetFriendListPage(baseCallback, C.GoString(operationID), int32(offset), int32(count), parseBool(int(filterBlack))) } //export search_friends @@ -797,6 +752,12 @@ func search_friends(operationID *C.char, searchParam *C.char) { open_im_sdk.SearchFriends(baseCallback, C.GoString(operationID), C.GoString(searchParam)) } +//export update_friends +func update_friends(operationID *C.char, req *C.char) { + baseCallback := NewBaseCallback(operationID, DataType_Empty) + open_im_sdk.UpdateFriends(baseCallback, C.GoString(operationID), C.GoString(req)) +} + //export check_friend func check_friend(operationID *C.char, userIDList *C.char) { baseCallback := NewBaseCallback(operationID, DataType_UserIDResult_List) @@ -809,12 +770,6 @@ func add_friend(operationID *C.char, userIDReqMsg *C.char) { open_im_sdk.AddFriend(baseCallback, C.GoString(operationID), C.GoString(userIDReqMsg)) } -//export set_friend_remark -func set_friend_remark(operationID *C.char, userIDRemark *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetFriendRemark(baseCallback, C.GoString(operationID), C.GoString(userIDRemark)) -} - //export delete_friend func delete_friend(operationID *C.char, friendUserID *C.char) { baseCallback := NewBaseCallback(operationID, DataType_Empty) @@ -914,15 +869,6 @@ func change_group_member_mute(operationID, groupId, userId *C.char, mutedSeconds int(mutedSeconds)) } -// SetGroupMemberRoleLevel sets the role level of a group member -// -//export set_group_member_role_level -func set_group_member_role_level(operationID, groupId, userId *C.char, roleLevel C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGroupMemberRoleLevel(baseCallback, C.GoString(operationID), C.GoString(groupId), - C.GoString(userId), int(roleLevel)) -} - // SetGroupMemberInfo sets the information of a group member // //export set_group_member_info @@ -963,30 +909,6 @@ func set_group_info(operationID, groupInfo *C.char) { open_im_sdk.SetGroupInfo(baseCallback, C.GoString(operationID), C.GoString(groupInfo)) } -// SetGroupVerification sets the verification mode of a group -// -//export set_group_verification -func set_group_verification(operationID, groupId *C.char, verification C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGroupVerification(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(verification)) -} - -// SetGroupLookMemberInfo sets the member information visibility of a group -// -//export set_group_look_member_info -func set_group_look_member_info(operationID, groupId *C.char, cRule C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGroupLookMemberInfo(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(cRule)) -} - -// SetGroupApplyMemberFriend sets the friend rule for group applicants -// -//export set_group_apply_member_friend -func set_group_apply_member_friend(operationID, groupId *C.char, cRule C.int) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGroupApplyMemberFriend(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(cRule)) -} - // GetGroupMemberList retrieves the list of group members // //export get_group_member_list @@ -1084,15 +1006,6 @@ func refuse_group_application(operationID, groupId, fromUserId, handleMsg *C.cha C.GoString(fromUserId), C.GoString(handleMsg)) } -// SetGroupMemberNickname sets the nickname of a group member -// -//export set_group_member_nickname -func set_group_member_nickname(operationID, groupId, userId, groupMemberNickname *C.char) { - baseCallback := NewBaseCallback(operationID, DataType_Empty) - open_im_sdk.SetGroupMemberNickname(baseCallback, C.GoString(operationID), C.GoString(groupId), - C.GoString(userId), C.GoString(groupMemberNickname)) -} - // SearchGroupMembers searches for group members // //export search_group_members diff --git a/go.mod b/go.mod index 6bde0f1..ec1687e 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,37 @@ module github.com/openimsdk/openim-sdk-cpp -go 1.18 +go 1.21 -require github.com/openimsdk/openim-sdk-core/v3 v3.5.1-alpha.8 +require github.com/openimsdk/openim-sdk-core/v3 v3.8.1 require ( - github.com/OpenIMSDK/protocol v0.0.40 // indirect - github.com/OpenIMSDK/tools v0.0.24 // indirect - github.com/bwmarrin/snowflake v0.3.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/openimsdk/protocol v0.0.72-alpha.24 // indirect + github.com/openimsdk/tools v0.0.50-alpha.14 // indirect + golang.org/x/sync v0.6.0 // indirect +) + +require ( + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect - github.com/jinzhu/copier v0.3.5 // indirect + github.com/jinzhu/copier v0.4.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect - github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect github.com/lestrrat-go/strftime v1.0.6 // indirect - github.com/mattn/go-sqlite3 v1.14.12 // indirect - github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect + github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect; indirecv3.5.1-alpha.8t go.uber.org/zap v1.24.0 // indirect - golang.org/x/image v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/image v0.15.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 // indirect - google.golang.org/grpc v1.56.2 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gorm.io/driver/sqlite v1.3.6 // indirect - gorm.io/gorm v1.23.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/grpc v1.62.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gorm.io/driver/sqlite v1.5.5 // indirect + gorm.io/gorm v1.25.10 // indirect nhooyr.io/websocket v1.8.10 // indirect ) diff --git a/go.sum b/go.sum index 367d1f2..ce3bf67 100644 --- a/go.sum +++ b/go.sum @@ -1,41 +1,36 @@ -github.com/OpenIMSDK/protocol v0.0.40 h1:1/Oij6RSAaePCPrWGwp9Cyz976/8Uxr94hM5M5FXzlg= -github.com/OpenIMSDK/protocol v0.0.40/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= -github.com/OpenIMSDK/tools v0.0.24 h1:P8n7ZtsZEbm4W3dQAem29O+bigzy6YPXxFzd/D8Vh3U= -github.com/OpenIMSDK/tools v0.0.24/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= +github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= +github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= +github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= -github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/openimsdk/openim-sdk-core/v3 v3.5.1-alpha.8 h1:kPjlkSHX7PsBz0Af+Jk1PB4sraup7mbmmwyA3f8uEBI= -github.com/openimsdk/openim-sdk-core/v3 v3.5.1-alpha.8/go.mod h1:d2aVHT6pSYthQQd+/4JaruHPTLsQV2D+eQisRQkoP3I= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/openimsdk/openim-sdk-core/v3 v3.8.1 h1:oI+pGKC0WhFI32aeGlsYILyE9VY2XSpvrCfMtKq6UjI= +github.com/openimsdk/openim-sdk-core/v3 v3.8.1/go.mod h1:RH16NC8BTyGM53Sjxe8lpzkTemWvehfgeLvOKY4IUps= +github.com/openimsdk/protocol v0.0.72-alpha.24 h1:1Dl8TEZVXhdmve+ewoLkJa2wbFBIHqPgjvr9u/J66JM= +github.com/openimsdk/protocol v0.0.72-alpha.24/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8= +github.com/openimsdk/tools v0.0.50-alpha.14 h1:7mqOwJWHcG181KvkmU+oJn9ZpYNoUykt9WtuOQg4sDU= +github.com/openimsdk/tools v0.0.50-alpha.14/go.mod h1:h1cYmfyaVtgFbKmb1Cfsl8XwUOMTt8ubVUQrdGtsUh4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -44,36 +39,37 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= -golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= +golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 h1:XUODHrpzJEUeWmVo/jfNTLj0YyVveOo28oE6vkFbkO4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= -google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gorm.io/driver/sqlite v1.3.6 h1:Fi8xNYCUplOqWiPa3/GuCeowRNBRGTf62DEmhMDHeQQ= -gorm.io/driver/sqlite v1.3.6/go.mod h1:Sg1/pvnKtbQ7jLXxfZa+jSHvoX8hoZA8cn4xllOMTgE= -gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.23.8 h1:h8sGJ+biDgBA1AD1Ha9gFCx7h8npU7AsLdlkX0n2TpE= -gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E= +gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE= +gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s= +gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/message.go b/message.go index a05007b..b72fe7d 100644 --- a/message.go +++ b/message.go @@ -8,9 +8,11 @@ const ( Msg_ConnectFailed Msg_KickedOffline Msg_UserTokenExpired + Msg_UserTokenInvalid Msg_SyncServerStart Msg_SyncServerFinish + Msg_SyncServerProgress Msg_SyncServerFailed Msg_NewConversation Msg_ConversationChanged @@ -57,6 +59,9 @@ const ( Msg_SelfInfoUpdated Msg_UserStatusChanged + Msg_UserCommandAdd + Msg_UserCommandDelete + Msg_UserCommandUpdate Msg_SendMessage_Error Msg_SendMessage_Success @@ -105,6 +110,7 @@ const ( type Empty struct { } + type Error struct { OperationID string `json:"operationId"` ErrCode int32 `json:"errCode"`