Skip to content

Commit 26d71a7

Browse files
committed
update sdk to 3.8.1
1 parent 3bd7099 commit 26d71a7

File tree

5 files changed

+120
-203
lines changed

5 files changed

+120
-203
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.o
22
*.obj
3+
*.h
34
*.gch
45
*.pch
56
*.so

export.go

+55-142
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,51 @@ func NewConnCallback() *ConnCallback {
6666
func (c ConnCallback) OnConnecting() {
6767
DispatorMsg(Msg_Connecting, Empty{})
6868
}
69-
7069
func (c ConnCallback) OnConnectSuccess() {
7170
DispatorMsg(Msg_ConnectSuccess, Empty{})
7271
}
73-
7472
func (c ConnCallback) OnConnectFailed(errCode int32, errMsg string) {
7573
DispatorMsg(Msg_ConnectFailed, Error{ErrCode: errCode, ErrMsg: errMsg})
7674
}
77-
7875
func (c ConnCallback) OnKickedOffline() {
7976
DispatorMsg(Msg_KickedOffline, Empty{})
8077
}
8178
func (c ConnCallback) OnUserTokenExpired() {
8279
DispatorMsg(Msg_UserTokenExpired, Empty{})
8380
}
81+
func (c ConnCallback) OnUserTokenInvalid(errMsg string) {
82+
DispatorMsg(Msg_UserTokenInvalid, Error{ErrCode: 0, ErrMsg: errMsg})
83+
}
8484

8585
type ConversationCallback struct {
8686
}
8787

8888
func NewConversationCallback() *ConversationCallback {
8989
return &ConversationCallback{}
9090
}
91-
func (c ConversationCallback) OnSyncServerStart() {
92-
DispatorMsg(Msg_SyncServerStart, Empty{})
93-
}
94-
func (c ConversationCallback) OnSyncServerFinish() {
95-
DispatorMsg(Msg_SyncServerFinish, Empty{})
96-
}
97-
func (c ConversationCallback) OnSyncServerFailed() {
98-
DispatorMsg(Msg_SyncServerFailed, Empty{})
91+
func (c ConversationCallback) OnSyncServerStart(reinstalled bool) {
92+
DispatorMsg(Msg_SyncServerStart, struct {
93+
Reinstalled bool `json:"reinstalled"`
94+
}{
95+
Reinstalled: reinstalled,
96+
})
97+
}
98+
func (c ConversationCallback) OnSyncServerFinish(reinstalled bool) {
99+
DispatorMsg(Msg_SyncServerFinish, struct {
100+
Reinstalled bool `json:"reinstalled"`
101+
}{
102+
Reinstalled: reinstalled,
103+
})
104+
}
105+
func (c ConversationCallback) OnSyncServerProgress(progress int) {
106+
DispatorMsg(Msg_SyncServerProgress, Progress{Progress: progress})
107+
}
108+
func (c ConversationCallback) OnSyncServerFailed(reinstalled bool) {
109+
DispatorMsg(Msg_SyncServerFailed, struct {
110+
Reinstalled bool `json:"reinstalled"`
111+
}{
112+
Reinstalled: reinstalled,
113+
})
99114
}
100115
func (c ConversationCallback) OnNewConversation(conversationList string) {
101116
DispatorMsg(Msg_NewConversation, conversationList)
@@ -253,11 +268,18 @@ type UserCallback struct {
253268
func (u UserCallback) OnSelfInfoUpdated(userInfo string) {
254269
DispatorMsg(Msg_SelfInfoUpdated, userInfo)
255270
}
256-
257271
func (u UserCallback) OnUserStatusChanged(statusMap string) {
258272
DispatorMsg(Msg_UserStatusChanged, statusMap)
259273
}
260-
274+
func (u UserCallback) OnUserCommandAdd(userCommand string) {
275+
DispatorMsg(Msg_UserCommandAdd, userCommand)
276+
}
277+
func (u UserCallback) OnUserCommandDelete(userCommand string) {
278+
DispatorMsg(Msg_UserCommandDelete, userCommand)
279+
}
280+
func (u UserCallback) OnUserCommandUpdate(userCommand string) {
281+
DispatorMsg(Msg_UserCommandUpdate, userCommand)
282+
}
261283
func NewUserCallback() *UserCallback {
262284
return &UserCallback{}
263285
}
@@ -510,28 +532,16 @@ func get_multiple_conversation(operationID *C.char, conversationIDList *C.char)
510532
open_im_sdk.GetMultipleConversation(baseCallback, C.GoString(operationID), C.GoString(conversationIDList))
511533
}
512534

513-
//export set_conversation_msg_destruct_time
514-
func set_conversation_msg_destruct_time(operationID *C.char, conversationID *C.char, msgDestructTime C.longlong) {
515-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
516-
open_im_sdk.SetConversationMsgDestructTime(baseCallback, C.GoString(operationID), C.GoString(conversationID), int64(msgDestructTime))
517-
}
518-
519-
//export set_conversation_is_msg_destruct
520-
func set_conversation_is_msg_destruct(operationID *C.char, conversationID *C.char, isMsgDestruct C.int) {
521-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
522-
open_im_sdk.SetConversationIsMsgDestruct(baseCallback, C.GoString(operationID), C.GoString(conversationID), parseBool(int(isMsgDestruct)))
523-
}
524-
525535
//export hide_conversation
526536
func hide_conversation(operationID *C.char, conversationID *C.char) {
527537
baseCallback := NewBaseCallback(operationID, DataType_Empty)
528538
open_im_sdk.HideConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID))
529539
}
530540

531-
//export get_conversation_recv_message_opt
532-
func get_conversation_recv_message_opt(operationID *C.char, conversationIDList *C.char) {
533-
baseCallback := NewBaseCallback(operationID, DataType_GetConversationRecvMessageOptResp_List)
534-
open_im_sdk.GetConversationRecvMessageOpt(baseCallback, C.GoString(operationID), C.GoString(conversationIDList))
541+
//export set_conversation
542+
func set_conversation(operationID *C.char, conversationID, req *C.char) {
543+
baseCallback := NewBaseCallback(operationID, DataType_Empty)
544+
open_im_sdk.SetConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID), C.GoString(req))
535545
}
536546

537547
//export set_conversation_draft
@@ -540,37 +550,6 @@ func set_conversation_draft(operationID *C.char, conversationID *C.char, draftTe
540550
open_im_sdk.SetConversationDraft(baseCallback, C.GoString(operationID), C.GoString(conversationID), C.GoString(draftText))
541551
}
542552

543-
//export reset_conversation_group_at_type
544-
func reset_conversation_group_at_type(operationID *C.char, conversationID *C.char) {
545-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
546-
open_im_sdk.ResetConversationGroupAtType(baseCallback, C.GoString(operationID), C.GoString(conversationID))
547-
}
548-
549-
//export pin_conversation
550-
func pin_conversation(operationID *C.char, conversationID *C.char, isPinned C.int) {
551-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
552-
open_im_sdk.PinConversation(baseCallback, C.GoString(operationID), C.GoString(conversationID), parseBool(int(isPinned)))
553-
}
554-
555-
//export set_conversation_private_chat
556-
func set_conversation_private_chat(operationID *C.char, conversationID *C.char, isPrivate C.int) {
557-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
558-
open_im_sdk.SetConversationPrivateChat(baseCallback, C.GoString(operationID), C.GoString(conversationID),
559-
parseBool(int(isPrivate)))
560-
}
561-
562-
//export set_conversation_burn_duration
563-
func set_conversation_burn_duration(operationID *C.char, conversationID *C.char, duration C.int) {
564-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
565-
open_im_sdk.SetConversationBurnDuration(baseCallback, C.GoString(operationID), C.GoString(conversationID), int32(duration))
566-
}
567-
568-
//export set_conversation_recv_message_opt
569-
func set_conversation_recv_message_opt(operationID *C.char, conversationID *C.char, opt C.int) {
570-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
571-
open_im_sdk.SetConversationRecvMessageOpt(baseCallback, C.GoString(operationID), C.GoString(conversationID), int(opt))
572-
}
573-
574553
//export get_total_unread_msg_count
575554
func get_total_unread_msg_count(operationID *C.char) {
576555
baseCallback := NewBaseCallback(operationID, DataType_Int)
@@ -588,17 +567,17 @@ func get_conversation_id_by_session_type(operationID *C.char, sourceID *C.char,
588567
}
589568

590569
//export send_message
591-
func send_message(operationID, message, recvID, groupID, offlinePushInfo *C.char) {
570+
func send_message(operationID, message, recvID, groupID, offlinePushInfo *C.char, isOnlineOnly C.int) {
592571
sendMsgCallback := NewSendMessageCallback(operationID)
593572
open_im_sdk.SendMessage(sendMsgCallback, C.GoString(operationID), C.GoString(message), C.GoString(recvID),
594-
C.GoString(groupID), C.GoString(offlinePushInfo))
573+
C.GoString(groupID), C.GoString(offlinePushInfo), parseBool(int(isOnlineOnly)))
595574
}
596575

597576
//export send_message_not_oss
598-
func send_message_not_oss(operationID, message, recvID, groupID, offlinePushInfo *C.char) {
577+
func send_message_not_oss(operationID, message, recvID, groupID, offlinePushInfo *C.char, isOnlineOnly C.int) {
599578
sendMsgCallback := NewSendMessageCallback(operationID)
600579
open_im_sdk.SendMessageNotOss(sendMsgCallback, C.GoString(operationID), C.GoString(message), C.GoString(recvID),
601-
C.GoString(groupID), C.GoString(offlinePushInfo))
580+
C.GoString(groupID), C.GoString(offlinePushInfo), parseBool(int(isOnlineOnly)))
602581
}
603582

604583
//export find_message_list
@@ -711,42 +690,18 @@ func get_users_info(operationID *C.char, userIDs *C.char) {
711690
open_im_sdk.GetUsersInfo(baseCallback, C.GoString(operationID), C.GoString(userIDs))
712691
}
713692

714-
//export get_users_info_with_cache
715-
func get_users_info_with_cache(operationID *C.char, userIDs *C.char, groupID *C.char) {
716-
baseCallback := NewBaseCallback(operationID, DataType_FullUserInfoWithCache_List)
717-
open_im_sdk.GetUsersInfoWithCache(baseCallback, C.GoString(operationID), C.GoString(userIDs), C.GoString(groupID))
718-
}
719-
720-
//export get_users_info_from_srv
721-
func get_users_info_from_srv(operationID *C.char, userIDs *C.char) {
722-
baseCallback := NewBaseCallback(operationID, DataType_LocalUser_List)
723-
open_im_sdk.GetUsersInfoFromSrv(baseCallback, C.GoString(operationID), C.GoString(userIDs))
724-
}
725-
726693
//export set_self_info
727694
func set_self_info(operationID *C.char, userInfo *C.char) {
728695
baseCallback := NewBaseCallback(operationID, DataType_Empty)
729696
open_im_sdk.SetSelfInfo(baseCallback, C.GoString(operationID), C.GoString(userInfo))
730697
}
731698

732-
//export set_global_recv_message_opt
733-
func set_global_recv_message_opt(operationID *C.char, opt C.int) {
734-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
735-
open_im_sdk.SetGlobalRecvMessageOpt(baseCallback, C.GoString(operationID), int(opt))
736-
}
737-
738699
//export get_self_user_info
739700
func get_self_user_info(operationID *C.char) {
740701
baseCallback := NewBaseCallback(operationID, DataType_LocalUser)
741702
open_im_sdk.GetSelfUserInfo(baseCallback, C.GoString(operationID))
742703
}
743704

744-
//export update_msg_sender_info
745-
func update_msg_sender_info(operationID *C.char, nickname *C.char, faceURL *C.char) {
746-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
747-
open_im_sdk.UpdateMsgSenderInfo(baseCallback, C.GoString(operationID), C.GoString(nickname), C.GoString(faceURL))
748-
}
749-
750705
//export subscribe_users_status
751706
func subscribe_users_status(operationID *C.char, userIDs *C.char) {
752707
baseCallback := NewBaseCallback(operationID, DataType_OnlineStatus_List)
@@ -774,21 +729,21 @@ func get_user_status(operationID *C.char, userIDs *C.char) {
774729
// =====================================================friend===============================================
775730
//
776731
//export get_specified_friends_info
777-
func get_specified_friends_info(operationID *C.char, userIDList *C.char) {
732+
func get_specified_friends_info(operationID *C.char, userIDList *C.char, filterBlack C.int) {
778733
baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List)
779-
open_im_sdk.GetSpecifiedFriendsInfo(baseCallback, C.GoString(operationID), C.GoString(userIDList))
734+
open_im_sdk.GetSpecifiedFriendsInfo(baseCallback, C.GoString(operationID), C.GoString(userIDList), parseBool(int(filterBlack)))
780735
}
781736

782737
//export get_friend_list
783-
func get_friend_list(operationID *C.char) {
738+
func get_friend_list(operationID *C.char, filterBlack C.int) {
784739
baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List)
785-
open_im_sdk.GetFriendList(baseCallback, C.GoString(operationID))
740+
open_im_sdk.GetFriendList(baseCallback, C.GoString(operationID), parseBool(int(filterBlack)))
786741
}
787742

788743
//export get_friend_list_page
789-
func get_friend_list_page(operationID *C.char, offset C.int, count C.int) {
744+
func get_friend_list_page(operationID *C.char, offset C.int, count C.int, filterBlack C.int) {
790745
baseCallback := NewBaseCallback(operationID, DataType_FullUserInfo_List)
791-
open_im_sdk.GetFriendListPage(baseCallback, C.GoString(operationID), int32(offset), int32(count))
746+
open_im_sdk.GetFriendListPage(baseCallback, C.GoString(operationID), int32(offset), int32(count), parseBool(int(filterBlack)))
792747
}
793748

794749
//export search_friends
@@ -797,6 +752,12 @@ func search_friends(operationID *C.char, searchParam *C.char) {
797752
open_im_sdk.SearchFriends(baseCallback, C.GoString(operationID), C.GoString(searchParam))
798753
}
799754

755+
//export update_friends
756+
func update_friends(operationID *C.char, req *C.char) {
757+
baseCallback := NewBaseCallback(operationID, DataType_Empty)
758+
open_im_sdk.UpdateFriends(baseCallback, C.GoString(operationID), C.GoString(req))
759+
}
760+
800761
//export check_friend
801762
func check_friend(operationID *C.char, userIDList *C.char) {
802763
baseCallback := NewBaseCallback(operationID, DataType_UserIDResult_List)
@@ -809,12 +770,6 @@ func add_friend(operationID *C.char, userIDReqMsg *C.char) {
809770
open_im_sdk.AddFriend(baseCallback, C.GoString(operationID), C.GoString(userIDReqMsg))
810771
}
811772

812-
//export set_friend_remark
813-
func set_friend_remark(operationID *C.char, userIDRemark *C.char) {
814-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
815-
open_im_sdk.SetFriendRemark(baseCallback, C.GoString(operationID), C.GoString(userIDRemark))
816-
}
817-
818773
//export delete_friend
819774
func delete_friend(operationID *C.char, friendUserID *C.char) {
820775
baseCallback := NewBaseCallback(operationID, DataType_Empty)
@@ -914,15 +869,6 @@ func change_group_member_mute(operationID, groupId, userId *C.char, mutedSeconds
914869
int(mutedSeconds))
915870
}
916871

917-
// SetGroupMemberRoleLevel sets the role level of a group member
918-
//
919-
//export set_group_member_role_level
920-
func set_group_member_role_level(operationID, groupId, userId *C.char, roleLevel C.int) {
921-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
922-
open_im_sdk.SetGroupMemberRoleLevel(baseCallback, C.GoString(operationID), C.GoString(groupId),
923-
C.GoString(userId), int(roleLevel))
924-
}
925-
926872
// SetGroupMemberInfo sets the information of a group member
927873
//
928874
//export set_group_member_info
@@ -963,30 +909,6 @@ func set_group_info(operationID, groupInfo *C.char) {
963909
open_im_sdk.SetGroupInfo(baseCallback, C.GoString(operationID), C.GoString(groupInfo))
964910
}
965911

966-
// SetGroupVerification sets the verification mode of a group
967-
//
968-
//export set_group_verification
969-
func set_group_verification(operationID, groupId *C.char, verification C.int) {
970-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
971-
open_im_sdk.SetGroupVerification(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(verification))
972-
}
973-
974-
// SetGroupLookMemberInfo sets the member information visibility of a group
975-
//
976-
//export set_group_look_member_info
977-
func set_group_look_member_info(operationID, groupId *C.char, cRule C.int) {
978-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
979-
open_im_sdk.SetGroupLookMemberInfo(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(cRule))
980-
}
981-
982-
// SetGroupApplyMemberFriend sets the friend rule for group applicants
983-
//
984-
//export set_group_apply_member_friend
985-
func set_group_apply_member_friend(operationID, groupId *C.char, cRule C.int) {
986-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
987-
open_im_sdk.SetGroupApplyMemberFriend(baseCallback, C.GoString(operationID), C.GoString(groupId), int32(cRule))
988-
}
989-
990912
// GetGroupMemberList retrieves the list of group members
991913
//
992914
//export get_group_member_list
@@ -1084,15 +1006,6 @@ func refuse_group_application(operationID, groupId, fromUserId, handleMsg *C.cha
10841006
C.GoString(fromUserId), C.GoString(handleMsg))
10851007
}
10861008

1087-
// SetGroupMemberNickname sets the nickname of a group member
1088-
//
1089-
//export set_group_member_nickname
1090-
func set_group_member_nickname(operationID, groupId, userId, groupMemberNickname *C.char) {
1091-
baseCallback := NewBaseCallback(operationID, DataType_Empty)
1092-
open_im_sdk.SetGroupMemberNickname(baseCallback, C.GoString(operationID), C.GoString(groupId),
1093-
C.GoString(userId), C.GoString(groupMemberNickname))
1094-
}
1095-
10961009
// SearchGroupMembers searches for group members
10971010
//
10981011
//export search_group_members

0 commit comments

Comments
 (0)