@@ -208,7 +208,6 @@ public void gotResult(int status, String desc) {
208208
209209 public void userLogin (JSONArray data , final CallbackContext callback ) {
210210 String username , password ;
211-
212211 try {
213212 JSONObject params = data .getJSONObject (0 );
214213 username = params .getString ("username" );
@@ -2758,7 +2757,6 @@ public void onEvent(MessageRetractEvent event) throws JSONException {
27582757 public void onEvent (CommandNotificationEvent event ) throws JSONException {
27592758 final JSONObject result = new JSONObject ();
27602759 result .put ("content" , event .getMsg ());
2761-
27622760 event .getSenderUserInfo (new GetUserInfoCallback () {
27632761 @ Override
27642762 public void gotResult (int status , String desc , UserInfo userInfo ) {
@@ -2769,37 +2767,37 @@ public void gotResult(int status, String desc, UserInfo userInfo) {
27692767 e .printStackTrace ();
27702768 }
27712769 }
2772- }
2773- });
2770+ event .getTargetInfo (new CommandNotificationEvent .GetTargetInfoCallback () {
2771+ @ Override
2772+ public void gotResult (int status , String desc , Object obj , CommandNotificationEvent .Type type ) {
2773+ if (status == 0 ) {
2774+ if (type == CommandNotificationEvent .Type .single ) {
2775+ try {
2776+ UserInfo receiver = (UserInfo ) obj ;
2777+ result .put ("receiver" , toJson (receiver ));
2778+ result .put ("receiverType" , "single" );
2779+ } catch (JSONException e ) {
2780+ e .printStackTrace ();
2781+ }
27742782
2775- event .getTargetInfo (new CommandNotificationEvent .GetTargetInfoCallback () {
2776- @ Override
2777- public void gotResult (int status , String desc , Object obj , CommandNotificationEvent .Type type ) {
2778- if (status == 0 ) {
2779- if (type == CommandNotificationEvent .Type .single ) {
2780- try {
2781- UserInfo receiver = (UserInfo ) obj ;
2782- result .put ("receiver" , toJson (receiver ));
2783- result .put ("receiverType" , "single" );
2784- } catch (JSONException e ) {
2785- e .printStackTrace ();
2783+ } else {
2784+ try {
2785+ GroupInfo receiver = (GroupInfo ) obj ;
2786+ result .put ("receiver" , toJson (receiver ));
2787+ result .put ("receiverType" , "group" );
2788+ } catch (JSONException e ) {
2789+ e .printStackTrace ();
2790+ }
2791+ }
27862792 }
2793+ JSONObject eventJson = toJson ("receiveTransCommand" , result );
2794+ eventSuccess (eventJson );
27872795
2788- } else {
2789- try {
2790- GroupInfo receiver = (GroupInfo ) obj ;
2791- result .put ("receiver" , toJson (receiver ));
2792- result .put ("receiverType" , "group" );
2793- } catch (JSONException e ) {
2794- e .printStackTrace ();
2795- }
27962796 }
2797-
2798- JSONObject eventJson = toJson ("receiveTransCommand" , result );
2799- eventSuccess (eventJson );
2800- }
2797+ });
28012798 }
28022799 });
2800+
28032801 }
28042802
28052803 /**
@@ -2845,24 +2843,23 @@ public void gotResult(int status, String desc, UserInfo userInfo) {
28452843 e .printStackTrace ();
28462844 }
28472845 }
2848- }
2849- });
2850- event .getApprovalUserInfoList (new GetUserInfoListCallback () {
2851- @ Override
2852- public void gotResult (int status , String s , List <UserInfo > list ) {
2853- if (status == 0 ) {
2854- try {
2855- json .put ("joinGroupUsers" , toJson (list ));
2856- } catch (JSONException e ) {
2857- e .printStackTrace ();
2846+ event .getApprovalUserInfoList (new GetUserInfoListCallback () {
2847+ @ Override
2848+ public void gotResult (int status , String s , List <UserInfo > list ) {
2849+ if (status == 0 ) {
2850+ try {
2851+ json .put ("joinGroupUsers" , toJson (list ));
2852+ } catch (JSONException e ) {
2853+ e .printStackTrace ();
2854+ }
2855+ }
2856+ JSONObject eventJson = toJson ("receiveApplyJoinGroupApproval" , json );
2857+ eventSuccess (eventJson );
28582858 }
2859- }
2859+ });
28602860 }
28612861 });
28622862
2863- JSONObject eventJson = toJson ("receiveApplyJoinGroupApproval" , json );
2864- eventSuccess (eventJson );
2865-
28662863 }
28672864
28682865 /**
@@ -2884,24 +2881,22 @@ public void gotResult(int status, String desc, UserInfo userInfo) {
28842881 e .printStackTrace ();
28852882 }
28862883 }
2887- }
2888- });
2889- event .getApprovedUserInfoList (new GetUserInfoListCallback () {
2890- @ Override
2891- public void gotResult (int status , String s , List <UserInfo > list ) {
2892- if (status == 0 ) {
2893- try {
2894- json .put ("users" , toJson (list ));
2895- } catch (JSONException e ) {
2896- e .printStackTrace ();
2884+ event .getApprovedUserInfoList (new GetUserInfoListCallback () {
2885+ @ Override
2886+ public void gotResult (int status , String s , List <UserInfo > list ) {
2887+ if (status == 0 ) {
2888+ try {
2889+ json .put ("users" , toJson (list ));
2890+ } catch (JSONException e ) {
2891+ e .printStackTrace ();
2892+ }
2893+ }
2894+ JSONObject eventJson = toJson ("receiveGroupAdminApproval" , json );
2895+ eventSuccess (eventJson );
28972896 }
2898- }
2897+ });
28992898 }
29002899 });
2901-
2902- JSONObject eventJson = toJson ("receiveGroupAdminApproval" , json );
2903- eventSuccess (eventJson );
2904-
29052900 }
29062901
29072902 /**
@@ -2919,15 +2914,15 @@ public void gotResult(int status, String desc, UserInfo userInfo) {
29192914 if (status == 0 ) {
29202915 try {
29212916 json .put ("groupManager" , toJson (userInfo ));
2917+ JSONObject eventJson = toJson ("receiveGroupAdminReject" , json );
2918+ eventSuccess (eventJson );
29222919 } catch (JSONException e ) {
29232920 e .printStackTrace ();
29242921 }
29252922 }
29262923 }
29272924 });
29282925
2929- JSONObject eventJson = toJson ("receiveGroupAdminReject" , json );
2930- eventSuccess (eventJson );
29312926 }
29322927
29332928 private void eventSuccess (JSONObject value ) {
0 commit comments