修复缺少的接口请求

修复消息列表数组下标越界问题
This commit is contained in:
zlzw 2024-07-27 11:14:30 +08:00
parent 05f1bc6e20
commit 5f107fef25
5 changed files with 39 additions and 12 deletions

View File

@ -151,7 +151,14 @@ public abstract class AbsMainMessageChatListFragment extends Fragment {
if (code == 0 && info != null) {
List<MsgOnlineStatusBean> listUserBean = JSON.parseArray(Arrays.toString(info), MsgOnlineStatusBean.class);
for (int i = 0; i < srcList.size(); i++) {
srcList.get(i).mCore.setDraft(listUserBean.get(i).getOnline());
for (int j = 0; j < listUserBean.size(); j++) {
if (!StringUtil.isEmpty(srcList.get(i).mCore.getTargetId()) &&
srcList.get(i).mCore.getTargetId().equals(listUserBean.get(j).getId())) {
srcList.get(i).mCore.setDraft(listUserBean.get(j).getOnline());
break;
}
}
}
onRefreshListener.onFinish(srcList);
isNet = false;

View File

@ -705,6 +705,12 @@ public class CommonHttpUtil {
.params("behavior_type","5")
.execute(callback);
}
public static void sayHi(String toUid,String type,HttpCallback callback) {
HttpClient.getInstance().get("Pdluser.liveCall", "Pdluser.liveCall")
.params("target_uid",toUid)
.params("behavior_type",type)
.execute(callback);
}
/**
*获取聊天列表用户在线状态

View File

@ -4,7 +4,7 @@ ext {
buildToolsVersion: "29.0.2",
minSdkVersion : 23,
targetSdkVersion : 34,
versionCode : 538,
versionCode : 539,
versionName : "6.7.2",
namespace : "com.pandoralive.shayu"
]

View File

@ -762,6 +762,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
showMsgError();
return;
}
boolean isAnchor = CommonAppConfig.getInstance().getUserBean().getUsers_type().equals("C");
CommonHttpUtil.sayHi(mToUid, isAnchor ? "6" : "7",new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
}
});
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(mToUid));
}
}

View File

@ -610,6 +610,13 @@ public class UserHomeActivity extends AbsActivity {
showMsgError();
return;
}
boolean isAnchor = CommonAppConfig.getInstance().getUserBean().getUsers_type().equals("C");
CommonHttpUtil.sayHi(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), isAnchor ? "6" : "7", new com.yunbao.common.http.HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
}
});
EventBus.getDefault().post(new MainHomeCommunityToChatEvent().setTargetId(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id())));
}
});