@@ -66,36 +66,51 @@ func NewConnCallback() *ConnCallback {
66
66
func (c ConnCallback ) OnConnecting () {
67
67
DispatorMsg (Msg_Connecting , Empty {})
68
68
}
69
-
70
69
func (c ConnCallback ) OnConnectSuccess () {
71
70
DispatorMsg (Msg_ConnectSuccess , Empty {})
72
71
}
73
-
74
72
func (c ConnCallback ) OnConnectFailed (errCode int32 , errMsg string ) {
75
73
DispatorMsg (Msg_ConnectFailed , Error {ErrCode : errCode , ErrMsg : errMsg })
76
74
}
77
-
78
75
func (c ConnCallback ) OnKickedOffline () {
79
76
DispatorMsg (Msg_KickedOffline , Empty {})
80
77
}
81
78
func (c ConnCallback ) OnUserTokenExpired () {
82
79
DispatorMsg (Msg_UserTokenExpired , Empty {})
83
80
}
81
+ func (c ConnCallback ) OnUserTokenInvalid (errMsg string ) {
82
+ DispatorMsg (Msg_UserTokenInvalid , Error {ErrCode : 0 , ErrMsg : errMsg })
83
+ }
84
84
85
85
type ConversationCallback struct {
86
86
}
87
87
88
88
func NewConversationCallback () * ConversationCallback {
89
89
return & ConversationCallback {}
90
90
}
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
+ })
99
114
}
100
115
func (c ConversationCallback ) OnNewConversation (conversationList string ) {
101
116
DispatorMsg (Msg_NewConversation , conversationList )
@@ -253,11 +268,18 @@ type UserCallback struct {
253
268
func (u UserCallback ) OnSelfInfoUpdated (userInfo string ) {
254
269
DispatorMsg (Msg_SelfInfoUpdated , userInfo )
255
270
}
256
-
257
271
func (u UserCallback ) OnUserStatusChanged (statusMap string ) {
258
272
DispatorMsg (Msg_UserStatusChanged , statusMap )
259
273
}
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
+ }
261
283
func NewUserCallback () * UserCallback {
262
284
return & UserCallback {}
263
285
}
@@ -510,28 +532,16 @@ func get_multiple_conversation(operationID *C.char, conversationIDList *C.char)
510
532
open_im_sdk .GetMultipleConversation (baseCallback , C .GoString (operationID ), C .GoString (conversationIDList ))
511
533
}
512
534
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
-
525
535
//export hide_conversation
526
536
func hide_conversation (operationID * C.char , conversationID * C.char ) {
527
537
baseCallback := NewBaseCallback (operationID , DataType_Empty )
528
538
open_im_sdk .HideConversation (baseCallback , C .GoString (operationID ), C .GoString (conversationID ))
529
539
}
530
540
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 ))
535
545
}
536
546
537
547
//export set_conversation_draft
@@ -540,37 +550,6 @@ func set_conversation_draft(operationID *C.char, conversationID *C.char, draftTe
540
550
open_im_sdk .SetConversationDraft (baseCallback , C .GoString (operationID ), C .GoString (conversationID ), C .GoString (draftText ))
541
551
}
542
552
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
-
574
553
//export get_total_unread_msg_count
575
554
func get_total_unread_msg_count (operationID * C.char ) {
576
555
baseCallback := NewBaseCallback (operationID , DataType_Int )
@@ -588,17 +567,17 @@ func get_conversation_id_by_session_type(operationID *C.char, sourceID *C.char,
588
567
}
589
568
590
569
//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 ) {
592
571
sendMsgCallback := NewSendMessageCallback (operationID )
593
572
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 )) )
595
574
}
596
575
597
576
//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 ) {
599
578
sendMsgCallback := NewSendMessageCallback (operationID )
600
579
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 )) )
602
581
}
603
582
604
583
//export find_message_list
@@ -711,42 +690,18 @@ func get_users_info(operationID *C.char, userIDs *C.char) {
711
690
open_im_sdk .GetUsersInfo (baseCallback , C .GoString (operationID ), C .GoString (userIDs ))
712
691
}
713
692
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
-
726
693
//export set_self_info
727
694
func set_self_info (operationID * C.char , userInfo * C.char ) {
728
695
baseCallback := NewBaseCallback (operationID , DataType_Empty )
729
696
open_im_sdk .SetSelfInfo (baseCallback , C .GoString (operationID ), C .GoString (userInfo ))
730
697
}
731
698
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
-
738
699
//export get_self_user_info
739
700
func get_self_user_info (operationID * C.char ) {
740
701
baseCallback := NewBaseCallback (operationID , DataType_LocalUser )
741
702
open_im_sdk .GetSelfUserInfo (baseCallback , C .GoString (operationID ))
742
703
}
743
704
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
-
750
705
//export subscribe_users_status
751
706
func subscribe_users_status (operationID * C.char , userIDs * C.char ) {
752
707
baseCallback := NewBaseCallback (operationID , DataType_OnlineStatus_List )
@@ -774,21 +729,21 @@ func get_user_status(operationID *C.char, userIDs *C.char) {
774
729
// =====================================================friend===============================================
775
730
//
776
731
//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 ) {
778
733
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 )) )
780
735
}
781
736
782
737
//export get_friend_list
783
- func get_friend_list (operationID * C.char ) {
738
+ func get_friend_list (operationID * C.char , filterBlack C. int ) {
784
739
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 )) )
786
741
}
787
742
788
743
//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 ) {
790
745
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 )) )
792
747
}
793
748
794
749
//export search_friends
@@ -797,6 +752,12 @@ func search_friends(operationID *C.char, searchParam *C.char) {
797
752
open_im_sdk .SearchFriends (baseCallback , C .GoString (operationID ), C .GoString (searchParam ))
798
753
}
799
754
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
+
800
761
//export check_friend
801
762
func check_friend (operationID * C.char , userIDList * C.char ) {
802
763
baseCallback := NewBaseCallback (operationID , DataType_UserIDResult_List )
@@ -809,12 +770,6 @@ func add_friend(operationID *C.char, userIDReqMsg *C.char) {
809
770
open_im_sdk .AddFriend (baseCallback , C .GoString (operationID ), C .GoString (userIDReqMsg ))
810
771
}
811
772
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
-
818
773
//export delete_friend
819
774
func delete_friend (operationID * C.char , friendUserID * C.char ) {
820
775
baseCallback := NewBaseCallback (operationID , DataType_Empty )
@@ -914,15 +869,6 @@ func change_group_member_mute(operationID, groupId, userId *C.char, mutedSeconds
914
869
int (mutedSeconds ))
915
870
}
916
871
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
-
926
872
// SetGroupMemberInfo sets the information of a group member
927
873
//
928
874
//export set_group_member_info
@@ -963,30 +909,6 @@ func set_group_info(operationID, groupInfo *C.char) {
963
909
open_im_sdk .SetGroupInfo (baseCallback , C .GoString (operationID ), C .GoString (groupInfo ))
964
910
}
965
911
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
-
990
912
// GetGroupMemberList retrieves the list of group members
991
913
//
992
914
//export get_group_member_list
@@ -1084,15 +1006,6 @@ func refuse_group_application(operationID, groupId, fromUserId, handleMsg *C.cha
1084
1006
C .GoString (fromUserId ), C .GoString (handleMsg ))
1085
1007
}
1086
1008
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
-
1096
1009
// SearchGroupMembers searches for group members
1097
1010
//
1098
1011
//export search_group_members
0 commit comments