From 4125a69573a1b183be45782765b59d268b9829ea Mon Sep 17 00:00:00 2001 From: guozhen <878631970@qq.com> Date: Fri, 27 Dec 2024 16:29:33 +0800 Subject: [PATCH] =?UTF-8?q?MM=20=E5=8E=BB=E6=8E=89=E6=92=A4=E9=94=80?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=8C=E4=BF=AE=E6=94=B9MM=E4=B8=96?= =?UTF-8?q?=E7=95=8C=E8=81=8A=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 12 +- .../java/com/dskj/rbchat/IMUIKitConfig.java | 2 - .../main/chat/ChatConversationFragment.java | 332 ++++++++++-------- .../rbchat/main/chat/ChatTabFragment.java | 48 +-- .../dskj/rbchat/welcome/WelcomeActivity.java | 26 -- .../chatkit/ui/custom/ChatConfigManager.java | 2 +- .../kit/chatkit/ui/network/ApiService.java | 2 +- 7 files changed, 192 insertions(+), 232 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f570cea..b670e0e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -47,8 +47,8 @@ android { applicationId = "com.dskj.rbchat" minSdk = 24 targetSdk = 34 - versionCode = 194 - versionName = "1.9.4" + versionCode = 195 + versionName = "1.9.5" multiDexEnabled = true testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式 @@ -101,8 +101,8 @@ android { "\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\"" ) //正式服 - manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式 -// manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" + manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式 + // manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" } @@ -126,8 +126,8 @@ android { "\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\"" ) //测试APPKEY -// manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" - manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" + // manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" + manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" } diff --git a/app/src/main/java/com/dskj/rbchat/IMUIKitConfig.java b/app/src/main/java/com/dskj/rbchat/IMUIKitConfig.java index e6cd5f7..4a5337f 100644 --- a/app/src/main/java/com/dskj/rbchat/IMUIKitConfig.java +++ b/app/src/main/java/com/dskj/rbchat/IMUIKitConfig.java @@ -164,8 +164,6 @@ public class IMUIKitConfig { public static String SERVICES_IDS_TAG = "services_id"; public static String RING_MESSAGE_TAG = "message_rings"; public static String RING_CALL_TAG = "call_rings"; - //世界聊天ids - public static String SHIJIECHAT_IDS_TAG = "shijiechat_id"; /** * GoogleMap apikey diff --git a/app/src/main/java/com/dskj/rbchat/main/chat/ChatConversationFragment.java b/app/src/main/java/com/dskj/rbchat/main/chat/ChatConversationFragment.java index a881693..ae61092 100644 --- a/app/src/main/java/com/dskj/rbchat/main/chat/ChatConversationFragment.java +++ b/app/src/main/java/com/dskj/rbchat/main/chat/ChatConversationFragment.java @@ -87,6 +87,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Objects; +import java.util.concurrent.Callable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; @@ -121,7 +122,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe private Observer> unreadCountObserver; private ChatDraftDataDao dataDao; - private ChatTabFragment chatTabParentFragment; protected final EventNotify changeDraftEvent = new EventNotify() { @@ -223,111 +223,146 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe bindView(); registerObserver(); EventCenter.registerEventNotify(changeDraftEvent); -// if (conversationType != 1) { -// getNotifiesCount(); -// } + if (conversationType != 1) { + getNotifiesCount(); + } } - public ArrayList groupShiJieIds = new ArrayList<>(); //官方群聊 + private List groupIds = new ArrayList<>(); -// private void getNotifiesCount() { -// Api.getInstance().notifiesmessageCountNew(IMKitClient.account(), DataUtils.getCurrentTimeType(System.currentTimeMillis())) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new BaseObserver<>() { -// @Override -// public void onSuccess(Result feedbackResp) { -// LogUtils.i("获取到的错误:" + feedbackResp + "" + feedbackResp.data); -// String groupId = feedbackResp.data.getGroupId(); -// if (!TextUtils.isEmpty(groupId)) { -// try { -// JSONArray array = new JSONArray(groupId); -// if (array.length() > 0) { -// String values = array.getString(0); -// if (!TextUtils.isEmpty(values)) { -// String[] groupIdStr = values.split(","); -// groupShiJieIds.addAll(Arrays.asList(groupIdStr)); -// queryTeamInfo(); -// } -// } -// } catch (JSONException e) { -// throw new RuntimeException(e); -// } -// } -// } -// -// -// @Override -// public void onError(int code, String msg) { -// LogUtils.i("获取到的错误:" + code + "" + msg); -//// WidgetUtils.showToast(getActivity(), msg, WidgetUtils.ToastType.ERROR); -// LogUtils.i("获取到的错误:" + code + "" + msg); -// } -// }); -// } -// -// private void queryTeamInfo() { -// for (String groupId : groupShiJieIds) { -// NIMClient.getService(TeamService.class).searchTeam(groupId).setCallback(new RequestCallback() { -// @Override -// public void onSuccess(Team result) { -// addShiJieConversation(result); -// } -// -// @Override -// public void onFailed(int code) { -// -// } -// -// @Override -// public void onException(Throwable exception) { -// -// } -// }); -// } -// -// } -// public void addShiJieConversation(Team team) { -// RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); -// ConversationInfo info = new ConversationInfo(recentContact); -// info.setTeamInfo(team); -// info.setStickTop(true); -// ConversationBean conversationBean = new ConversationBean(info); -// conversationBean.isShiJie = true; -// List list = new ArrayList<>(); -// if (conversationType == 0) { -// boolean isAdd = false; -// for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) { -// if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { -// conversationBean1.infoData.setStickTop(true); -// conversationBean1.isShiJie = true; -// isAdd = true; -// break; -// } -// } -// if (!isAdd) { -// list.add(conversationBean); -// conversationViewTop.addData(list); -// } -// } else if (conversationType == 2) { -// boolean isAdd = false; -// for (ConversationBean conversationBean1 : conversationViewShiJie.getAdatper().getConversationList()) { -// if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { -// conversationBean1.infoData.setStickTop(true); -// conversationBean1.isShiJie = true; -// isAdd = true; -// break; -// } -// } -// if (!isAdd) { -// list.add(conversationBean); -// conversationViewShiJie.addData(list); -// } -// } -// -// -// } + private void getNotifiesCount() { + Api.getInstance().notifiesmessageCountNew(IMKitClient.account(), DataUtils.getCurrentTimeType(System.currentTimeMillis())) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new BaseObserver<>() { + @Override + public void onSuccess(Result feedbackResp) { + LogUtils.i("获取到的错误:" + feedbackResp + "" + feedbackResp.data); + String groupId = feedbackResp.data.getGroupId(); + if (!TextUtils.isEmpty(groupId)) { + try { + JSONArray array = new JSONArray(groupId); + if (array.length() > 0) { + String values = array.getString(0); + if (!TextUtils.isEmpty(values)) { + String[] groupIdStr = values.split(","); + groupIds.addAll(Arrays.asList(groupIdStr)); + queryTeamInfo(); + } + } + } catch (JSONException e) { + throw new RuntimeException(e); + } + } + } + + + @Override + public void onError(int code, String msg) { + LogUtils.i("获取到的错误:" + code + "" + msg); +// WidgetUtils.showToast(getActivity(), msg, WidgetUtils.ToastType.ERROR); + LogUtils.i("获取到的错误:" + code + "" + msg); + } + }); + } + + private void queryTeamInfo() { + for (String groupId : groupIds) { + NIMClient.getService(TeamService.class).searchTeam(groupId).setCallback(new RequestCallback() { + @Override + public void onSuccess(Team result) { + addShiJieConversation(result); + } + + @Override + public void onFailed(int code) { + + } + + @Override + public void onException(Throwable exception) { + + } + }); + } + + } + + public void addShiJieConversation(Team team) { + RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); + ConversationInfo info = new ConversationInfo(recentContact); + info.setTeamInfo(team); + ConversationBean conversationBean = new ConversationBean(info); + conversationBean.isShiJie = true; + conversationBean.infoData.setTeamInfo(team); + conversationBean.infoData.setStickTop(true); + List list = new ArrayList<>(); + if (conversationType == 0) { + boolean isAdd = false; + for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) { + Team team1 = conversationBean1.infoData.getTeamInfo(); + if (conversationBean1.isShiJie || (team1 != null && Objects.equals(team1.getId(), team.getId()))) { + conversationBean1.infoData.setStickTop(true); + conversationBean1.isShiJie = true; + conversationBean1.infoData.setTeamInfo(team1 == null ? team : team1); + isAdd = true; + break; + } + } + if (!isAdd) { + list.add(conversationBean); + conversationViewTop.addData(list); + conversationViewTop.addStickTop(team.getId()); + } + } else if (conversationType == 2) { + + ConversationBean conversationBeanItem = null; + + for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) { + if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + conversationBean1.infoData.setStickTop(true); + conversationBean1.isShiJie = true; + conversationBeanItem = conversationBean1; + conversationViewTop.getAdatper().removeData(conversationBean1.infoData.getContactId()); + break; + } + } + + for (ConversationBean conversationBean1 : conversationViewBottom.getAdatper().getConversationList()) { + if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + conversationBean1.infoData.setStickTop(true); + conversationBean1.isShiJie = true; + conversationBeanItem = conversationBean1; + conversationViewBottom.getAdatper().removeData(conversationBean1.infoData.getContactId()); + break; + } + } + setDataNumber(); + + boolean isAdd = false; + for (ConversationBean conversationBean1 : conversationViewShiJie.getAdatper().getConversationList()) { + if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + conversationBean1.infoData.setStickTop(true); + conversationBean1.isShiJie = true; + isAdd = true; + break; + } + } + if (!isAdd) { + if (conversationBeanItem != null) { + list.add(conversationBeanItem); + } else { + list.add(conversationBean); //有时候这个创建的空会话数据不全 + } + conversationViewShiJie.addData(list); + conversationViewShiJie.addStickTop(team.getId()); + } + + } + + + } private void registerObserver() { viewModel.getChangeLiveData().observeForever(changeObserver); @@ -391,7 +426,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe public List removeShiJieConversation(List conversationBeans) { List conversationBeans1 = new ArrayList<>(); for (ConversationBean conversationBean : conversationBeans) { - if (!chatTabParentFragment.groupIds.contains(conversationBean.infoData.getContactId())) { + if (!groupIds.contains(conversationBean.infoData.getContactId())) { conversationBeans1.add(conversationBean); } } @@ -422,7 +457,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } } - doEmptyView(); doCallback(); if (conversationType == 1) { @@ -470,6 +504,8 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe conversationViewTop.updateTeamInfoType(result.getData(), true); conversationViewBottom.updateTeamInfoType(result.getData(), false); conversationViewShiJie.updateTeamInfo(result.getData()); + doEmptyView(); + } } }; @@ -567,7 +603,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe private boolean showAllJoinTeam = false; private void initView() { - chatTabParentFragment = (ChatTabFragment) getParentFragment(); viewBinding.layoutShijiechat.setVisibility(View.GONE); conversationViewTop = viewBinding.conversationViewTop; conversationViewShiJie = viewBinding.conversationViewTeamShijie; @@ -638,6 +673,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } } + private void initData() { viewModel .getQueryLiveData() @@ -689,13 +725,13 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe switch (conversationType) { case 0: List listconversation = updateServicesConversation(result.getData()); - if (chatTabParentFragment.groupIds != null) { //添加世界聊天窗口 - LogUtils.d("shijie", "添加世界聊天==" + chatTabParentFragment.groupIds.size()); - List conversationShiJieList = addConversationTeamShiJie(listconversation); - LogUtils.d("shijie", "添加世界聊天==" + conversationShiJieList.size()); - listconversation.addAll(conversationShiJieList); - } - Collections.sort(listconversation, conversationShiJieComparator); +// if (chatTabParentFragment.groupIds != null) { //添加世界聊天窗口 +// LogUtils.d("shijie", "添加世界聊天==" + chatTabParentFragment.groupIds.size()); +// List conversationShiJieList = addConversationTeamShiJie(listconversation); +// LogUtils.d("shijie", "添加世界聊天==" + conversationShiJieList.size()); +// listconversation.addAll(conversationShiJieList); +// } +// Collections.sort(listconversation, conversationShiJieComparator); conversationViewTop.setData(listconversation); break; case 1: @@ -704,9 +740,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe break; case 2: getConversationTeamTypeList(result.getData()); - LogUtils.d("shijie", "添加世界聊天 群组 groupsid==" + chatTabParentFragment.groupIds.size()); - listGuanfangTeam.addAll(addConversationTeamShiJie(listGuanfangTeam)); - LogUtils.d("shijie", "添加世界聊天 群组==" + listGuanfangTeam.size()); setChatDraftDataList(listMyTeam); setChatDraftDataList(listJoinTeam); setChatDraftDataList(listGuanfangTeam); @@ -718,35 +751,35 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } - //在已有的会话中添加世界聊天会话 - public List addConversationTeamShiJie(List recentContactList) { - List listconversation = new ArrayList<>(); - for (int i = 0; i < chatTabParentFragment.groupIds.size(); i++) { - boolean isAdd = false; - for (ConversationBean conversationBean : recentContactList) { - if (conversationBean.infoData.getContactId().equals(chatTabParentFragment.groupIds.get(i))) { - conversationBean.isShiJie = true; - conversationBean.infoData.setStickTop(true); - isAdd = true; - } - } - if (!isAdd) { - RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(chatTabParentFragment.groupIds.get(i), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); - ConversationInfo info = new ConversationInfo(recentContact); - if (chatTabParentFragment.teamInfos.size() > 0) { - info.setTeamInfo(chatTabParentFragment.teamInfos.get(i)); - } - info.setStickTop(true); - ConversationBean conversationBean = new ConversationBean(info); - conversationBean.isShiJie = true; - listconversation.add(conversationBean); - } - - } - return listconversation; - - - } +// //在已有的会话中添加世界聊天会话 +// public List addConversationTeamShiJie(List recentContactList) { +// List listconversation = new ArrayList<>(); +// for (int i = 0; i < chatTabParentFragment.groupIds.size(); i++) { +// boolean isAdd = false; +// for (ConversationBean conversationBean : recentContactList) { +// if (conversationBean.infoData.getContactId().equals(chatTabParentFragment.groupIds.get(i))) { +// conversationBean.isShiJie = true; +// conversationBean.infoData.setStickTop(true); +// isAdd = true; +// } +// } +// if (!isAdd) { +// RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(chatTabParentFragment.groupIds.get(i), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); +// ConversationInfo info = new ConversationInfo(recentContact); +// if (chatTabParentFragment.teamInfos.size() > 0) { +// info.setTeamInfo(chatTabParentFragment.teamInfos.get(i)); +// } +// info.setStickTop(true); +// ConversationBean conversationBean = new ConversationBean(info); +// conversationBean.isShiJie = true; +// listconversation.add(conversationBean); +// } +// +// } +// return listconversation; +// +// +// } // // 設置包含世界聊天 @@ -803,7 +836,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe private void setUpdateViewData(int conversationType, List result) { switch (conversationType) { case 0: - LogUtils.d("shijie", "更新世界聊天" + result.size()); conversationViewTop.update(updateServicesConversation(result)); break; case 1: @@ -811,11 +843,9 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe conversationViewTop.update(updateServicesConversation(listFriend)); break; case 2: - LogUtils.d("shijie", "更新世界聊天2 " + result.size()); getConversationTeamTypeList(result); setChatDraftDataList(listMyTeam); setChatDraftDataList(listJoinTeam); - LogUtils.d("shijie", "更新世界聊天2 " + listGuanfangTeam.size()); conversationViewTop.update(listMyTeam); conversationViewBottom.update(listJoinTeam); conversationViewShiJie.update(listGuanfangTeam); @@ -851,7 +881,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe if (servicesIds == null || servicesIds.size() == 0) { return beans; } - if (chatTabParentFragment.groupIds == null) { + if (groupIds == null) { return beans; } @@ -862,7 +892,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe conversationBean.isServices = true; } if (conversationBean.infoData.getSessionType() == SessionTypeEnum.Team || conversationBean.infoData.getSessionType() == SessionTypeEnum.SUPER_TEAM) { - if (chatTabParentFragment.groupIds.contains(conversationBean.infoData.getContactId())) { + if (groupIds.contains(conversationBean.infoData.getContactId())) { conversationBean.isShiJie = true; conversationBean.infoData.setStickTop(true); } @@ -908,7 +938,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } public boolean isShiJieConversation(ConversationBean conversationBean) { - return chatTabParentFragment.groupIds.contains(conversationBean.infoData.getContactId()); + return groupIds.contains(conversationBean.infoData.getContactId()); } private void doEmptyView() { @@ -1126,4 +1156,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe EventCenter.unregisterEventNotify(changeDraftEvent); super.onDestroyView(); } + + } diff --git a/app/src/main/java/com/dskj/rbchat/main/chat/ChatTabFragment.java b/app/src/main/java/com/dskj/rbchat/main/chat/ChatTabFragment.java index 9a2f632..452cce2 100644 --- a/app/src/main/java/com/dskj/rbchat/main/chat/ChatTabFragment.java +++ b/app/src/main/java/com/dskj/rbchat/main/chat/ChatTabFragment.java @@ -158,7 +158,6 @@ public class ChatTabFragment extends BaseFragment { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); getServicesData(); - getGroupIdsData(); initView(); // NetworkUtils.registerNetworkStatusChangedListener(networkStateListener); EventCenter.registerEventNotify(editConversation); @@ -234,7 +233,6 @@ public class ChatTabFragment extends BaseFragment { int verifyCount = 0; int notifyCount = 0; public ArrayList groupIds = new ArrayList<>(); //官方群聊 - public List teamInfos = new ArrayList<>(); private void getNotifiesCount() { notifyCount = 0; @@ -260,7 +258,6 @@ public class ChatTabFragment extends BaseFragment { String[] groupIdStr = values.split(","); groupIds.clear(); groupIds.addAll(Arrays.asList(groupIdStr)); - queryTeamInfo(); } } } catch (JSONException e) { @@ -271,7 +268,8 @@ public class ChatTabFragment extends BaseFragment { if (activityMsgCount > msgcount) { DataUtils.set(getActivity(), "activity_message_count", activityMsgCount); } - notifyCount = count + activityMsgCount; + // notifyCount = count + activityMsgCount; MM 活动通知取消 + notifyCount = count + 0; setNotifyTotalCount(); } @@ -285,27 +283,7 @@ public class ChatTabFragment extends BaseFragment { }); } - private void queryTeamInfo() { - for (String groupId : groupIds) { - NIMClient.getService(TeamService.class).searchTeam(groupId).setCallback(new RequestCallback() { - @Override - public void onSuccess(Team result) { - teamInfos.add(result); - } - @Override - public void onFailed(int code) { - - } - - @Override - public void onException(Throwable exception) { - - } - }); - } - - } private void getServicesData() { String tagString = DataUtils.get(IMApplication.getAppContext(), IMUIKitConfig.SERVICES_IDS_TAG + "_" + IMKitClient.account(), ""); @@ -316,28 +294,6 @@ public class ChatTabFragment extends BaseFragment { } } - private void getGroupIdsData() { - String tagString = DataUtils.get(IMApplication.getAppContext(), IMUIKitConfig.SHIJIECHAT_IDS_TAG, ""); - if (!TextUtils.isEmpty(tagString)) { - try { - JSONArray array = new JSONArray(tagString); - if (array.length() > 0) { - String values = array.getString(0); - if (!TextUtils.isEmpty(values)) { - String[] groupIdStr = values.split(","); - groupIds.clear(); - groupIds.addAll(Arrays.asList(groupIdStr)); - queryTeamInfo(); - } - } - } catch (JSONException e) { - throw new RuntimeException(e); - } - - } - } - - public Comparator conversationComparator = (bean1, bean2) -> { int result; diff --git a/app/src/main/java/com/dskj/rbchat/welcome/WelcomeActivity.java b/app/src/main/java/com/dskj/rbchat/welcome/WelcomeActivity.java index 2cecbda..653afd8 100644 --- a/app/src/main/java/com/dskj/rbchat/welcome/WelcomeActivity.java +++ b/app/src/main/java/com/dskj/rbchat/welcome/WelcomeActivity.java @@ -106,7 +106,6 @@ public class WelcomeActivity extends BaseActivity { getScheme(uri); // initClip(); //activityWelcomeBinding.bigBg.setBackgroundResource(R.color.color_white); - getNotifiesCount(); if (TextUtils.isEmpty(NIMClient.getCurrentAccount())) { startLogin(); } else { @@ -141,31 +140,6 @@ public class WelcomeActivity extends BaseActivity { } - private void getNotifiesCount(){ - Api.getInstance().notifiesmessageCountNew(IMKitClient.account(), DataUtils.getCurrentTimeType(System.currentTimeMillis())) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new BaseObserver<>() { - @Override - public void onSuccess(Result feedbackResp) { - LogUtils.i("获取到的错误:" + feedbackResp + "" + feedbackResp.data); - - String groupId = feedbackResp.data.getGroupId(); - if (!TextUtils.isEmpty(groupId)) { - DataUtils.set(WelcomeActivity.this, IMUIKitConfig.SHIJIECHAT_IDS_TAG, groupId); - } - } - - - @Override - public void onError(int code, String msg) { - LogUtils.i("获取到的错误:" + code + "" + msg); -// WidgetUtils.showToast(getActivity(), msg, WidgetUtils.ToastType.ERROR); - LogUtils.i("获取到的错误:" + code + "" + msg); - } - }); - } - private void showIsLogin(boolean isLogin) { //加载动画 diff --git a/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/custom/ChatConfigManager.java b/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/custom/ChatConfigManager.java index 424c3ad..c529ac8 100644 --- a/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/custom/ChatConfigManager.java +++ b/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/custom/ChatConfigManager.java @@ -7,5 +7,5 @@ package com.netease.yunxin.kit.chatkit.ui.custom; public class ChatConfigManager { public static boolean showReadStatus = true; /** 收到撤销时是否能插入本地消息,默认插入 */ - public static boolean enableInsertLocalMsgWhenRevoke = true; + public static boolean enableInsertLocalMsgWhenRevoke = false; } diff --git a/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/network/ApiService.java b/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/network/ApiService.java index fb740fe..a1c7596 100644 --- a/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/network/ApiService.java +++ b/chatkit-ui/src/main/java/com/netease/yunxin/kit/chatkit/ui/network/ApiService.java @@ -54,7 +54,7 @@ public interface ApiService { /** * 测试环境 */ -// String URL = "https://api-test.letschat2023.com/"; + // String URL = "https://api-test.letschat2023.com/"; String SUBSTATIONID = "1703655363476242434";