MM 去掉撤销通知,修改MM世界聊天

This commit is contained in:
guozhen
2024-12-27 16:29:33 +08:00
committed by xuhuixiang
parent b13a542488
commit 4125a69573
7 changed files with 192 additions and 232 deletions

View File

@@ -47,8 +47,8 @@ android {
applicationId = "com.dskj.rbchat" applicationId = "com.dskj.rbchat"
minSdk = 24 minSdk = 24
targetSdk = 34 targetSdk = 34
versionCode = 194 versionCode = 195
versionName = "1.9.4" versionName = "1.9.5"
multiDexEnabled = true multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式 manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式
@@ -101,8 +101,8 @@ android {
"\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\"" "\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\""
) )
//正式服 //正式服
manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式 manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式
// manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" // manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
} }
@@ -126,8 +126,8 @@ android {
"\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\"" "\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\""
) )
//测试APPKEY //测试APPKEY
// manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a" // manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f"
} }

View File

@@ -164,8 +164,6 @@ public class IMUIKitConfig {
public static String SERVICES_IDS_TAG = "services_id"; public static String SERVICES_IDS_TAG = "services_id";
public static String RING_MESSAGE_TAG = "message_rings"; public static String RING_MESSAGE_TAG = "message_rings";
public static String RING_CALL_TAG = "call_rings"; public static String RING_CALL_TAG = "call_rings";
//世界聊天ids
public static String SHIJIECHAT_IDS_TAG = "shijiechat_id";
/** /**
* GoogleMap apikey * GoogleMap apikey

View File

@@ -87,6 +87,7 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.Callable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
@@ -121,7 +122,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
private Observer<FetchResult<Integer>> unreadCountObserver; private Observer<FetchResult<Integer>> unreadCountObserver;
private ChatDraftDataDao dataDao; private ChatDraftDataDao dataDao;
private ChatTabFragment chatTabParentFragment;
protected final EventNotify<ChangeChatDraftEvent> changeDraftEvent = protected final EventNotify<ChangeChatDraftEvent> changeDraftEvent =
new EventNotify<ChangeChatDraftEvent>() { new EventNotify<ChangeChatDraftEvent>() {
@@ -223,111 +223,146 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
bindView(); bindView();
registerObserver(); registerObserver();
EventCenter.registerEventNotify(changeDraftEvent); EventCenter.registerEventNotify(changeDraftEvent);
// if (conversationType != 1) { if (conversationType != 1) {
// getNotifiesCount(); getNotifiesCount();
// } }
} }
public ArrayList<String> groupShiJieIds = new ArrayList<>(); //官方群聊 private List<String> groupIds = new ArrayList<>();
// private void getNotifiesCount() { private void getNotifiesCount() {
// Api.getInstance().notifiesmessageCountNew(IMKitClient.account(), DataUtils.getCurrentTimeType(System.currentTimeMillis())) Api.getInstance().notifiesmessageCountNew(IMKitClient.account(), DataUtils.getCurrentTimeType(System.currentTimeMillis()))
// .subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new BaseObserver<>() { .subscribe(new BaseObserver<>() {
// @Override @Override
// public void onSuccess(Result<NotifyCountBean> feedbackResp) { public void onSuccess(Result<NotifyCountBean> feedbackResp) {
// LogUtils.i("获取到的错误:" + feedbackResp + "" + feedbackResp.data); LogUtils.i("获取到的错误:" + feedbackResp + "" + feedbackResp.data);
// String groupId = feedbackResp.data.getGroupId(); String groupId = feedbackResp.data.getGroupId();
// if (!TextUtils.isEmpty(groupId)) { if (!TextUtils.isEmpty(groupId)) {
// try { try {
// JSONArray array = new JSONArray(groupId); JSONArray array = new JSONArray(groupId);
// if (array.length() > 0) { if (array.length() > 0) {
// String values = array.getString(0); String values = array.getString(0);
// if (!TextUtils.isEmpty(values)) { if (!TextUtils.isEmpty(values)) {
// String[] groupIdStr = values.split(","); String[] groupIdStr = values.split(",");
// groupShiJieIds.addAll(Arrays.asList(groupIdStr)); groupIds.addAll(Arrays.asList(groupIdStr));
// queryTeamInfo(); queryTeamInfo();
// } }
// } }
// } catch (JSONException e) { } catch (JSONException e) {
// throw new RuntimeException(e); throw new RuntimeException(e);
// } }
// } }
// } }
//
//
// @Override @Override
// public void onError(int code, String msg) { public void onError(int code, String msg) {
// LogUtils.i("获取到的错误:" + code + "" + msg); LogUtils.i("获取到的错误:" + code + "" + msg);
//// WidgetUtils.showToast(getActivity(), msg, WidgetUtils.ToastType.ERROR); // WidgetUtils.showToast(getActivity(), msg, WidgetUtils.ToastType.ERROR);
// LogUtils.i("获取到的错误:" + code + "" + msg); LogUtils.i("获取到的错误:" + code + "" + msg);
// } }
// }); });
// } }
//
// private void queryTeamInfo() { private void queryTeamInfo() {
// for (String groupId : groupShiJieIds) { for (String groupId : groupIds) {
// NIMClient.getService(TeamService.class).searchTeam(groupId).setCallback(new RequestCallback<Team>() { NIMClient.getService(TeamService.class).searchTeam(groupId).setCallback(new RequestCallback<Team>() {
// @Override @Override
// public void onSuccess(Team result) { public void onSuccess(Team result) {
// addShiJieConversation(result); addShiJieConversation(result);
// } }
//
// @Override @Override
// public void onFailed(int code) { public void onFailed(int code) {
//
// } }
//
// @Override @Override
// public void onException(Throwable exception) { 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); public void addShiJieConversation(Team team) {
// ConversationInfo info = new ConversationInfo(recentContact); RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true);
// info.setTeamInfo(team); ConversationInfo info = new ConversationInfo(recentContact);
// info.setStickTop(true); info.setTeamInfo(team);
// ConversationBean conversationBean = new ConversationBean(info); ConversationBean conversationBean = new ConversationBean(info);
// conversationBean.isShiJie = true; conversationBean.isShiJie = true;
// List<ConversationBean> list = new ArrayList<>(); conversationBean.infoData.setTeamInfo(team);
// if (conversationType == 0) { conversationBean.infoData.setStickTop(true);
// boolean isAdd = false; List<ConversationBean> list = new ArrayList<>();
// for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) { if (conversationType == 0) {
// if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { boolean isAdd = false;
// conversationBean1.infoData.setStickTop(true); for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) {
// conversationBean1.isShiJie = true; Team team1 = conversationBean1.infoData.getTeamInfo();
// isAdd = true; if (conversationBean1.isShiJie || (team1 != null && Objects.equals(team1.getId(), team.getId()))) {
// break; conversationBean1.infoData.setStickTop(true);
// } conversationBean1.isShiJie = true;
// } conversationBean1.infoData.setTeamInfo(team1 == null ? team : team1);
// if (!isAdd) { isAdd = true;
// list.add(conversationBean); break;
// conversationViewTop.addData(list); }
// } }
// } else if (conversationType == 2) { if (!isAdd) {
// boolean isAdd = false; list.add(conversationBean);
// for (ConversationBean conversationBean1 : conversationViewShiJie.getAdatper().getConversationList()) { conversationViewTop.addData(list);
// if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { conversationViewTop.addStickTop(team.getId());
// conversationBean1.infoData.setStickTop(true); }
// conversationBean1.isShiJie = true; } else if (conversationType == 2) {
// isAdd = true;
// break; ConversationBean conversationBeanItem = null;
// }
// } for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) {
// if (!isAdd) { if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) {
// list.add(conversationBean); conversationBean1.infoData.setStickTop(true);
// conversationViewShiJie.addData(list); 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() { private void registerObserver() {
viewModel.getChangeLiveData().observeForever(changeObserver); viewModel.getChangeLiveData().observeForever(changeObserver);
@@ -391,7 +426,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
public List<ConversationBean> removeShiJieConversation(List<ConversationBean> conversationBeans) { public List<ConversationBean> removeShiJieConversation(List<ConversationBean> conversationBeans) {
List<ConversationBean> conversationBeans1 = new ArrayList<>(); List<ConversationBean> conversationBeans1 = new ArrayList<>();
for (ConversationBean conversationBean : conversationBeans) { for (ConversationBean conversationBean : conversationBeans) {
if (!chatTabParentFragment.groupIds.contains(conversationBean.infoData.getContactId())) { if (!groupIds.contains(conversationBean.infoData.getContactId())) {
conversationBeans1.add(conversationBean); conversationBeans1.add(conversationBean);
} }
} }
@@ -422,7 +457,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
} }
} }
doEmptyView(); doEmptyView();
doCallback(); doCallback();
if (conversationType == 1) { if (conversationType == 1) {
@@ -470,6 +504,8 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
conversationViewTop.updateTeamInfoType(result.getData(), true); conversationViewTop.updateTeamInfoType(result.getData(), true);
conversationViewBottom.updateTeamInfoType(result.getData(), false); conversationViewBottom.updateTeamInfoType(result.getData(), false);
conversationViewShiJie.updateTeamInfo(result.getData()); conversationViewShiJie.updateTeamInfo(result.getData());
doEmptyView();
} }
} }
}; };
@@ -567,7 +603,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
private boolean showAllJoinTeam = false; private boolean showAllJoinTeam = false;
private void initView() { private void initView() {
chatTabParentFragment = (ChatTabFragment) getParentFragment();
viewBinding.layoutShijiechat.setVisibility(View.GONE); viewBinding.layoutShijiechat.setVisibility(View.GONE);
conversationViewTop = viewBinding.conversationViewTop; conversationViewTop = viewBinding.conversationViewTop;
conversationViewShiJie = viewBinding.conversationViewTeamShijie; conversationViewShiJie = viewBinding.conversationViewTeamShijie;
@@ -638,6 +673,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
} }
} }
private void initData() { private void initData() {
viewModel viewModel
.getQueryLiveData() .getQueryLiveData()
@@ -689,13 +725,13 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
switch (conversationType) { switch (conversationType) {
case 0: case 0:
List<ConversationBean> listconversation = updateServicesConversation(result.getData()); List<ConversationBean> listconversation = updateServicesConversation(result.getData());
if (chatTabParentFragment.groupIds != null) { //添加世界聊天窗口 // if (chatTabParentFragment.groupIds != null) { //添加世界聊天窗口
LogUtils.d("shijie", "添加世界聊天==" + chatTabParentFragment.groupIds.size()); // LogUtils.d("shijie", "添加世界聊天==" + chatTabParentFragment.groupIds.size());
List<ConversationBean> conversationShiJieList = addConversationTeamShiJie(listconversation); // List<ConversationBean> conversationShiJieList = addConversationTeamShiJie(listconversation);
LogUtils.d("shijie", "添加世界聊天==" + conversationShiJieList.size()); // LogUtils.d("shijie", "添加世界聊天==" + conversationShiJieList.size());
listconversation.addAll(conversationShiJieList); // listconversation.addAll(conversationShiJieList);
} // }
Collections.sort(listconversation, conversationShiJieComparator); // Collections.sort(listconversation, conversationShiJieComparator);
conversationViewTop.setData(listconversation); conversationViewTop.setData(listconversation);
break; break;
case 1: case 1:
@@ -704,9 +740,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
break; break;
case 2: case 2:
getConversationTeamTypeList(result.getData()); getConversationTeamTypeList(result.getData());
LogUtils.d("shijie", "添加世界聊天 群组 groupsid==" + chatTabParentFragment.groupIds.size());
listGuanfangTeam.addAll(addConversationTeamShiJie(listGuanfangTeam));
LogUtils.d("shijie", "添加世界聊天 群组==" + listGuanfangTeam.size());
setChatDraftDataList(listMyTeam); setChatDraftDataList(listMyTeam);
setChatDraftDataList(listJoinTeam); setChatDraftDataList(listJoinTeam);
setChatDraftDataList(listGuanfangTeam); setChatDraftDataList(listGuanfangTeam);
@@ -718,35 +751,35 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
} }
//在已有的会话中添加世界聊天会话 // //在已有的会话中添加世界聊天会话
public List<ConversationBean> addConversationTeamShiJie(List<ConversationBean> recentContactList) { // public List<ConversationBean> addConversationTeamShiJie(List<ConversationBean> recentContactList) {
List<ConversationBean> listconversation = new ArrayList<>(); // List<ConversationBean> listconversation = new ArrayList<>();
for (int i = 0; i < chatTabParentFragment.groupIds.size(); i++) { // for (int i = 0; i < chatTabParentFragment.groupIds.size(); i++) {
boolean isAdd = false; // boolean isAdd = false;
for (ConversationBean conversationBean : recentContactList) { // for (ConversationBean conversationBean : recentContactList) {
if (conversationBean.infoData.getContactId().equals(chatTabParentFragment.groupIds.get(i))) { // if (conversationBean.infoData.getContactId().equals(chatTabParentFragment.groupIds.get(i))) {
conversationBean.isShiJie = true; // conversationBean.isShiJie = true;
conversationBean.infoData.setStickTop(true); // conversationBean.infoData.setStickTop(true);
isAdd = true; // isAdd = true;
} // }
} // }
if (!isAdd) { // if (!isAdd) {
RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(chatTabParentFragment.groupIds.get(i), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); // RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(chatTabParentFragment.groupIds.get(i), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true);
ConversationInfo info = new ConversationInfo(recentContact); // ConversationInfo info = new ConversationInfo(recentContact);
if (chatTabParentFragment.teamInfos.size() > 0) { // if (chatTabParentFragment.teamInfos.size() > 0) {
info.setTeamInfo(chatTabParentFragment.teamInfos.get(i)); // info.setTeamInfo(chatTabParentFragment.teamInfos.get(i));
} // }
info.setStickTop(true); // info.setStickTop(true);
ConversationBean conversationBean = new ConversationBean(info); // ConversationBean conversationBean = new ConversationBean(info);
conversationBean.isShiJie = true; // conversationBean.isShiJie = true;
listconversation.add(conversationBean); // listconversation.add(conversationBean);
} // }
//
} // }
return listconversation; // return listconversation;
//
//
} // }
// // 設置包含世界聊天 // // 設置包含世界聊天
@@ -803,7 +836,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
private void setUpdateViewData(int conversationType, List<ConversationBean> result) { private void setUpdateViewData(int conversationType, List<ConversationBean> result) {
switch (conversationType) { switch (conversationType) {
case 0: case 0:
LogUtils.d("shijie", "更新世界聊天" + result.size());
conversationViewTop.update(updateServicesConversation(result)); conversationViewTop.update(updateServicesConversation(result));
break; break;
case 1: case 1:
@@ -811,11 +843,9 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
conversationViewTop.update(updateServicesConversation(listFriend)); conversationViewTop.update(updateServicesConversation(listFriend));
break; break;
case 2: case 2:
LogUtils.d("shijie", "更新世界聊天2 " + result.size());
getConversationTeamTypeList(result); getConversationTeamTypeList(result);
setChatDraftDataList(listMyTeam); setChatDraftDataList(listMyTeam);
setChatDraftDataList(listJoinTeam); setChatDraftDataList(listJoinTeam);
LogUtils.d("shijie", "更新世界聊天2 " + listGuanfangTeam.size());
conversationViewTop.update(listMyTeam); conversationViewTop.update(listMyTeam);
conversationViewBottom.update(listJoinTeam); conversationViewBottom.update(listJoinTeam);
conversationViewShiJie.update(listGuanfangTeam); conversationViewShiJie.update(listGuanfangTeam);
@@ -851,7 +881,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
if (servicesIds == null || servicesIds.size() == 0) { if (servicesIds == null || servicesIds.size() == 0) {
return beans; return beans;
} }
if (chatTabParentFragment.groupIds == null) { if (groupIds == null) {
return beans; return beans;
} }
@@ -862,7 +892,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
conversationBean.isServices = true; conversationBean.isServices = true;
} }
if (conversationBean.infoData.getSessionType() == SessionTypeEnum.Team || conversationBean.infoData.getSessionType() == SessionTypeEnum.SUPER_TEAM) { 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.isShiJie = true;
conversationBean.infoData.setStickTop(true); conversationBean.infoData.setStickTop(true);
} }
@@ -908,7 +938,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
} }
public boolean isShiJieConversation(ConversationBean conversationBean) { public boolean isShiJieConversation(ConversationBean conversationBean) {
return chatTabParentFragment.groupIds.contains(conversationBean.infoData.getContactId()); return groupIds.contains(conversationBean.infoData.getContactId());
} }
private void doEmptyView() { private void doEmptyView() {
@@ -1126,4 +1156,6 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe
EventCenter.unregisterEventNotify(changeDraftEvent); EventCenter.unregisterEventNotify(changeDraftEvent);
super.onDestroyView(); super.onDestroyView();
} }
} }

View File

@@ -158,7 +158,6 @@ public class ChatTabFragment extends BaseFragment {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
getServicesData(); getServicesData();
getGroupIdsData();
initView(); initView();
// NetworkUtils.registerNetworkStatusChangedListener(networkStateListener); // NetworkUtils.registerNetworkStatusChangedListener(networkStateListener);
EventCenter.registerEventNotify(editConversation); EventCenter.registerEventNotify(editConversation);
@@ -234,7 +233,6 @@ public class ChatTabFragment extends BaseFragment {
int verifyCount = 0; int verifyCount = 0;
int notifyCount = 0; int notifyCount = 0;
public ArrayList<String> groupIds = new ArrayList<>(); //官方群聊 public ArrayList<String> groupIds = new ArrayList<>(); //官方群聊
public List<Team> teamInfos = new ArrayList<>();
private void getNotifiesCount() { private void getNotifiesCount() {
notifyCount = 0; notifyCount = 0;
@@ -260,7 +258,6 @@ public class ChatTabFragment extends BaseFragment {
String[] groupIdStr = values.split(","); String[] groupIdStr = values.split(",");
groupIds.clear(); groupIds.clear();
groupIds.addAll(Arrays.asList(groupIdStr)); groupIds.addAll(Arrays.asList(groupIdStr));
queryTeamInfo();
} }
} }
} catch (JSONException e) { } catch (JSONException e) {
@@ -271,7 +268,8 @@ public class ChatTabFragment extends BaseFragment {
if (activityMsgCount > msgcount) { if (activityMsgCount > msgcount) {
DataUtils.set(getActivity(), "activity_message_count", activityMsgCount); DataUtils.set(getActivity(), "activity_message_count", activityMsgCount);
} }
notifyCount = count + activityMsgCount; // notifyCount = count + activityMsgCount; MM 活动通知取消
notifyCount = count + 0;
setNotifyTotalCount(); 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<Team>() {
@Override
public void onSuccess(Team result) {
teamInfos.add(result);
}
@Override
public void onFailed(int code) {
}
@Override
public void onException(Throwable exception) {
}
});
}
}
private void getServicesData() { private void getServicesData() {
String tagString = DataUtils.get(IMApplication.getAppContext(), IMUIKitConfig.SERVICES_IDS_TAG + "_" + IMKitClient.account(), ""); 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<ConversationInfo> conversationComparator = public Comparator<ConversationInfo> conversationComparator =
(bean1, bean2) -> { (bean1, bean2) -> {
int result; int result;

View File

@@ -106,7 +106,6 @@ public class WelcomeActivity extends BaseActivity {
getScheme(uri); getScheme(uri);
// initClip(); // initClip();
//activityWelcomeBinding.bigBg.setBackgroundResource(R.color.color_white); //activityWelcomeBinding.bigBg.setBackgroundResource(R.color.color_white);
getNotifiesCount();
if (TextUtils.isEmpty(NIMClient.getCurrentAccount())) { if (TextUtils.isEmpty(NIMClient.getCurrentAccount())) {
startLogin(); startLogin();
} else { } 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<NotifyCountBean> 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) { private void showIsLogin(boolean isLogin) {
//加载动画 //加载动画

View File

@@ -7,5 +7,5 @@ package com.netease.yunxin.kit.chatkit.ui.custom;
public class ChatConfigManager { public class ChatConfigManager {
public static boolean showReadStatus = true; public static boolean showReadStatus = true;
/** 收到撤销时是否能插入本地消息,默认插入 */ /** 收到撤销时是否能插入本地消息,默认插入 */
public static boolean enableInsertLocalMsgWhenRevoke = true; public static boolean enableInsertLocalMsgWhenRevoke = false;
} }

View File

@@ -54,7 +54,7 @@ public interface ApiService {
/** /**
* 测试环境 * 测试环境
*/ */
// String URL = "https://api-test.letschat2023.com/"; // String URL = "https://api-test.letschat2023.com/";
String SUBSTATIONID = "1703655363476242434"; String SUBSTATIONID = "1703655363476242434";