被踢后5分钟内不能进入此房间

This commit is contained in:
huangjian
2022-09-02 16:34:39 +08:00
parent 3fad9a227a
commit 9433586dfd
5 changed files with 78 additions and 18 deletions

View File

@@ -281,6 +281,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
} else if (event == RoomEvent.ROOM_CHAT_RECONNECTION) {
updateRoomState();
} else if (event == RoomEvent.MY_SELF_KICK_OUT_ROOM_BY_S_ADMIN) {
AvRoomDataManager.get().addCurrentRoomLimitEnter();
toast(R.string.kick_out_room_by_s_admin);
StatisticManager.Instance().onEvent(StatisticsProtocol.USER_KICKED_EVENT, "用户被踢");
getMvpPresenter().exitRoom();

View File

@@ -126,6 +126,7 @@ import com.yizhuan.xchat_android_core.utils.StringUtils;
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
import com.yizhuan.xchat_android_library.rxbus.RxBus;
import com.yizhuan.xchat_android_library.utils.JavaUtil;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import com.yizhuan.xchat_android_library.utils.UIUtils;
import org.greenrobot.eventbus.EventBus;
@@ -230,6 +231,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
* @param roomInfo
*/
public static void start(Context context, @NonNull RoomInfo roomInfo) {
if (AvRoomDataManager.get().isLimitEnterRoom(String.valueOf(roomInfo.getRoomUid()))) {
SingleToastUtil.showToast("抱歉,您暂时无法进入该房间");
return;
}
Intent intent = new Intent(context, AVRoomActivity.class);
intent.putExtra(Constants.ROOM_INFO, (Parcelable) roomInfo);
intent.putExtra(Constants.ROOM_UID, roomInfo.getUid());
@@ -245,6 +250,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
@Nullable String fromUid,
@Nullable RedPackageNotifyInfo notifyInfo,
int giftId) {
if (AvRoomDataManager.get().isLimitEnterRoom(String.valueOf(roomUid))) {
SingleToastUtil.showToast("抱歉,您暂时无法进入该房间");
return;
}
Intent intent = new Intent(context, AVRoomActivity.class);
intent.putExtra(Constants.ROOM_UID, roomUid);
intent.putExtra("fromType", fromType);
@@ -607,6 +616,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
} else if (reasonReason == ChatRoomKickOutEvent.ChatRoomKickOutReason.CHAT_ROOM_INVALID) {
showLiveFinishView(AvRoomDataManager.get().getRoomUid());
} else if (reasonReason == ChatRoomKickOutEvent.ChatRoomKickOutReason.KICK_OUT_BY_MANAGER) {
AvRoomDataManager.get().addCurrentRoomLimitEnter();
if (SAdminOptUtil.isOptBySAdmin(reason)) {
toast(R.string.kick_out_room_by_s_admin);
} else {