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 ae61092..a7b6f90 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 @@ -289,8 +289,25 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } +// public void updateShiJieTeamInfo(List result) { +// for (Team team : result) { +// if (groupIds.contains(team.getId()) && conversationViewShiJie.getAdatper().getConversationList().size() == 0) { +// List list = new ArrayList<>(); +// RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.SUPER_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.add(conversationBean); +// conversationViewShiJie.setData(list); +// } +// } +// } + public void addShiJieConversation(Team team) { - RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.Team, 0, System.currentTimeMillis(), true, true); + RecentContact recentContact = NIMClient.getService(MsgService.class).createEmptyRecentContact(team.getId(), SessionTypeEnum.SUPER_TEAM, 0, System.currentTimeMillis(), true, true); ConversationInfo info = new ConversationInfo(recentContact); info.setTeamInfo(team); ConversationBean conversationBean = new ConversationBean(info); @@ -302,7 +319,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe 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()))) { + if (conversationBean1.infoData.getContactId().equals(team.getId())) { conversationBean1.infoData.setStickTop(true); conversationBean1.isShiJie = true; conversationBean1.infoData.setTeamInfo(team1 == null ? team : team1); @@ -320,7 +337,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe ConversationBean conversationBeanItem = null; for (ConversationBean conversationBean1 : conversationViewTop.getAdatper().getConversationList()) { - if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + if (conversationBean1.infoData.getContactId().equals(team.getId())) { conversationBean1.infoData.setStickTop(true); conversationBean1.isShiJie = true; conversationBeanItem = conversationBean1; @@ -330,7 +347,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe } for (ConversationBean conversationBean1 : conversationViewBottom.getAdatper().getConversationList()) { - if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + if (conversationBean1.infoData.getContactId().equals(team.getId())) { conversationBean1.infoData.setStickTop(true); conversationBean1.isShiJie = true; conversationBeanItem = conversationBean1; @@ -342,7 +359,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe boolean isAdd = false; for (ConversationBean conversationBean1 : conversationViewShiJie.getAdatper().getConversationList()) { - if (conversationBean1.infoData.getTeamInfo() != null && Objects.equals(conversationBean1.infoData.getTeamInfo().getId(), team.getId())) { + if (conversationBean1.infoData.getContactId().equals(team.getId())) { conversationBean1.infoData.setStickTop(true); conversationBean1.isShiJie = true; isAdd = true; @@ -500,6 +517,7 @@ public class ChatConversationFragment extends BaseFragment implements ILoadListe LogUtils.d("shijie", "更新群组信息" + result.getData().size() + " conversation size==" + conversationViewTop.getDataSize()); conversationViewTop.updateTeamInfo(result.getData()); } else if (conversationType == 2) { + // updateShiJieTeamInfo(result.getData()); LogUtils.d("shijie", "更新群组信息" + result.getData().size() + " conversationshijie size==" + conversationViewShiJie.getDataSize()); conversationViewTop.updateTeamInfoType(result.getData(), true); conversationViewBottom.updateTeamInfoType(result.getData(), false);