فهرست منبع

修改IM入口

Pq 1 سال پیش
والد
کامیت
2fa7190534

+ 4 - 6
student/src/main/java/com/cooleshow/student/widgets/helper/JsInterfaceAccomPanyUtils.java

@@ -14,6 +14,7 @@ import com.cooleshow.base.common.WebApi;
 import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.utils.LogUtils;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
 import com.cooleshow.student.helper.EventHelper;
 import com.cooleshow.usercenter.constants.UserConstants;
 import com.cooleshow.usercenter.helper.UserHelper;
@@ -66,12 +67,9 @@ public class JsInterfaceAccomPanyUtils extends Object {
                 } else if ("openConversationActivity".equals(api)) {
                     JSONObject contentBean = jsonObject.getJSONObject("content");
                     if (null != contentBean) {
-                        RongIM.getInstance().startPrivateChat(activity, contentBean.getString("userId"), contentBean.getString("name"));
-                        if (!TextUtils.isEmpty(contentBean.getString("img"))) {
-                            RongIM.getInstance().refreshUserInfoCache(new UserInfo(contentBean.getString("userId"),
-                                    contentBean.getString("name"),
-                                    Uri.parse(contentBean.getString("img"))));
-                        }
+                        String userId = contentBean.optString("userId");
+                        String name = contentBean.optString("name");
+                        ChatHelper.getInstance().goChat(userId,name);
                     }
                 } else if ("videoUpdate".equals(api)) {
                     if (onListener != null) {

+ 4 - 6
student/src/main/java/com/cooleshow/student/widgets/helper/JsInterfaceUtils.java

@@ -14,6 +14,7 @@ import android.webkit.JavascriptInterface;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.cooleshow.base.common.WebApi;
 import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
 import com.cooleshow.student.helper.EventHelper;
 import com.cooleshow.usercenter.constants.UserConstants;
 import com.cooleshow.usercenter.helper.UserHelper;
@@ -62,12 +63,9 @@ public class JsInterfaceUtils extends Object {
                 if ("openConversationActivity".equals(api)) {
                     JSONObject contentBean = jsonObject.getJSONObject("content");
                     if (null != contentBean) {
-                        RongIM.getInstance().startPrivateChat(activity, contentBean.getString("userId"), contentBean.getString("name"));
-                        if (!TextUtils.isEmpty(contentBean.getString("img"))) {
-                            RongIM.getInstance().refreshUserInfoCache(new UserInfo(contentBean.getString("userId"),
-                                    contentBean.getString("name"),
-                                    Uri.parse(contentBean.getString("img"))));
-                        }
+                        String userId = contentBean.optString("userId");
+                        String name = contentBean.optString("name");
+                        ChatHelper.getInstance().goChat(userId,name);
                     }
                 }
                 if (TextUtils.equals("chooseFile", api)) {

+ 2 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/MineStyleFragment.java

@@ -11,6 +11,7 @@ import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.ui.video.VideoPlayActivity;
 import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.adapter.MineStyleFansGroupListAdapter;
 import com.cooleshow.teacher.adapter.MineStyleVideoListAdapter;
@@ -145,6 +146,6 @@ public class MineStyleFragment extends BaseMVPFragment<FragmentMineStyleLayoutBi
     }
 
     private void goChat(String groupId, String groupName) {
-        RongIM.getInstance().startGroupChat(getContext(), groupId, groupName);
+        ChatHelper.getInstance().goGroupChat(groupId,"");
     }
 }

+ 4 - 6
teacher/src/main/java/com/cooleshow/teacher/widgets/helper/JsInterfaceAccomPanyUtils.java

@@ -13,6 +13,7 @@ import com.cooleshow.base.common.WebApi;
 import com.cooleshow.base.common.WebConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.utils.LogUtils;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
 import com.cooleshow.teacher.helper.EventHelper;
 import com.cooleshow.usercenter.constants.UserConstants;
 import com.cooleshow.usercenter.helper.UserHelper;
@@ -62,12 +63,9 @@ public class JsInterfaceAccomPanyUtils extends Object {
                 }else if ("openConversationActivity".equals(api)) {
                     JSONObject contentBean = jsonObject.getJSONObject("content");
                     if (null != contentBean) {
-                        RongIM.getInstance().startPrivateChat(activity, contentBean.getString("userId"), contentBean.getString("name"));
-                        if (!TextUtils.isEmpty(contentBean.getString("img"))) {
-                            RongIM.getInstance().refreshUserInfoCache(new UserInfo(contentBean.getString("userId"),
-                                    contentBean.getString("name"),
-                                    Uri.parse(contentBean.getString("img"))));
-                        }
+                        String userId = contentBean.optString("userId");
+                        String name = contentBean.optString("name");
+                        ChatHelper.getInstance().goChat(userId,name);
                     }
                 } else if ("videoUpdate".equals(api)) {
                     if (onListener != null) {

+ 4 - 6
teacher/src/main/java/com/cooleshow/teacher/widgets/helper/JsInterfaceUtils.java

@@ -14,6 +14,7 @@ import com.alibaba.android.arouter.launcher.ARouter;
 import com.cooleshow.base.common.WebApi;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.utils.LogUtils;
+import com.cooleshow.chatmodule.utils.helper.ChatHelper;
 import com.cooleshow.teacher.helper.EventHelper;
 import com.cooleshow.usercenter.constants.UserConstants;
 import com.cooleshow.usercenter.helper.UserHelper;
@@ -63,12 +64,9 @@ public class JsInterfaceUtils extends Object {
                 if ("openConversationActivity".equals(api)) {
                     JSONObject contentBean = jsonObject.getJSONObject("content");
                     if (null != contentBean) {
-                        RongIM.getInstance().startPrivateChat(activity, contentBean.getString("userId"), contentBean.getString("name"));
-                        if (!TextUtils.isEmpty(contentBean.getString("img"))) {
-                            RongIM.getInstance().refreshUserInfoCache(new UserInfo(contentBean.getString("userId"),
-                                    contentBean.getString("name"),
-                                    Uri.parse(contentBean.getString("img"))));
-                        }
+                        String userId = contentBean.optString("userId");
+                        String name = contentBean.optString("name");
+                        ChatHelper.getInstance().goChat(userId,name);
                     }
                     return;
                 }