Commit 9624fcf8 by 霍志良

feat:删除聊天记录

parent 87528e41
......@@ -208,25 +208,9 @@ public class YDLTeamMessageFragment extends YDLMessageFragment {
dialog.setCancelAble(true);
dialog.setLeftOnclick("再考虑下", v -> dialog.dismiss());
dialog.setRightClick("立即删除", v -> {
LoadingDialogFragment loadingDialog = LoadingDialogFragment.Companion.newInstance("正在删除");
loadingDialog.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), null);
RemoveHistory cmd = new RemoveHistory();
cmd.toUid = team.getId();
cmd.type = 1;
Disposable disposable = ImRetrofitApi.Companion.getImRetrofitApi().rmHistory(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io())
.compose(RxUtils.INSTANCE.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(objectBaseResponse -> {
loadingDialog.hide();
ToastUtil.toastShort("聊天记录已删除");
NIMClient.getService(MsgService.class).clearChattingHistory(cmd.toUid, SessionTypeEnum.P2P);
MessageListPanelHelper.getInstance().notifyClearMessages(cmd.toUid);
}, throwable -> {
loadingDialog.hide();
HttpErrorUtils.Companion.handleError(getContext(), throwable);
});
ToastUtil.toastShort("聊天记录已删除");
NIMClient.getService(MsgService.class).clearServerHistory(team.getId(),SessionTypeEnum.Team);
MessageListPanelHelper.getInstance().notifyClearMessages(team.getId());
});
dialog.show();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment