新增清空房间公屏功能

This commit is contained in:
huangjian
2022-04-25 16:34:11 +08:00
parent ddc5dcf55d
commit be72b2659e
16 changed files with 195 additions and 120 deletions

View File

@@ -122,6 +122,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
addSuperAdminAction(optAdapter);
addSendBroadcastAction(optAdapter);
addVipSendBroadcastAction(optAdapter);
addCleanScreenAction(optAdapter);
rvOPtList.setAdapter(optAdapter);
}
@@ -601,6 +602,28 @@ public class RoomOperationDialog extends BottomSheetDialog {
));
}
/**
* 清空公屏
*/
private void addCleanScreenAction(OptAdapter optAdapter) {
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
if (roomInfo == null) {
return;
}
if (!AvRoomDataManager.get().isManager()) {
return;
}
optAdapter.addData(new OptAction(R.drawable.icon_room_vip_send_broadcast,
"清空公屏",
() -> new DialogManager(context)
.showOkCancelDialog("确定要清空公屏消息吗(清空后不可恢复哦~)", () ->
AvRoomModel.get().cleanScreen(roomInfo.getUid(), AuthModel.get().getCurrentUid())
.doOnSuccess(s -> SingleToastUtil.showToast("清空公屏成功!"))
.doOnError(throwable -> SingleToastUtil.showToast(throwable.getMessage()))
.subscribe())
));
}
@Override
protected void onStop() {
super.onStop();

View File

@@ -370,6 +370,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
}
}
RoomEvent.LEAVE_MODE -> microView.adapter.notifyDataSetChanged()
RoomEvent.ROOM_CLEAN_SCREEN -> messageView.clear()
}
}

View File

@@ -136,6 +136,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
AvRoomDataManager.get().avatar = roomInfo.getAvatar();
AvRoomDataManager.get().isRoomFans = roomInfo.isRoomFans();
AvRoomDataManager.get().trtcSig = roomInfo.getTrtcSig();
AvRoomDataManager.get().clearScreenTime = roomInfo.getClearScreenTime();
AvRoomDataManager.get().setRedEnvelopeOpen(roomInfo.isRedEnvelopeOpen());
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_LIST_TYPE,
"区分房间类型:" + roomInfo.getRoomTypeLable());

View File

@@ -528,8 +528,12 @@ public class BaseRoomPresenter<V extends IBaseRoomView> extends BaseMvpPresenter
InitInfo initInfo = InitialModel.get().getCacheInitInfo();
if (initInfo != null) count = initInfo.getRoomMessageCount();
NIMClient.getService(ChatRoomService.class)
.pullMessageHistoryExType(String.valueOf(roomInfo.getRoomId()), 0,
count, QueryDirectionEnum.QUERY_OLD, new MsgTypeEnum[]{MsgTypeEnum.text})
.pullMessageHistoryExType(
String.valueOf(roomInfo.getRoomId()),
AvRoomDataManager.get().clearScreenTime,
count,
AvRoomDataManager.get().clearScreenTime == 0 ? QueryDirectionEnum.QUERY_OLD : QueryDirectionEnum.QUERY_NEW,
new MsgTypeEnum[]{MsgTypeEnum.text})
.setCallback(new RequestCallbackWrapper<List<ChatRoomMessage>>() {
@Override
public void onResult(int code, List<ChatRoomMessage> result, Throwable exception) {

View File

@@ -84,6 +84,7 @@ import com.yizhuan.xchat_android_core.home.event.FollowRoomEvent;
import com.yizhuan.xchat_android_core.home.model.CollectionRoomModel;
import com.yizhuan.xchat_android_core.im.custom.bean.AuctionAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.CarveUpGoldAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.CleanScreenAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.DatingAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.FaceAttachment;
@@ -850,6 +851,8 @@ public class MessageView extends FrameLayout {
setUpdateScreenMsg(tvContent, content);
} else if (second == CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_NOTICE) {
setUpdateRoomPureModeMsg(tvContent, chatRoomMessage);
} else if (second == CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLEAN_SCREEN) {
setCleanScreenMsg(tvContent, chatRoomMessage);
}
} else if (first == CustomAttachment.CUSTOM_MSG_DRAGON_BAR) {
if (second == CustomAttachment.CUSTOM_MSG_DRAGON_BAR_END) {
@@ -1658,6 +1661,27 @@ public class MessageView extends FrameLayout {
tvContent.setText(text.build());
}
private void setCleanScreenMsg(TextView tvContent, IMMessage message) {
CleanScreenAttachment attachment = (CleanScreenAttachment) message.getAttachment();
// 内容
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(attachment.getRoleType() == 1 ? "房主" : "管理员", new ForegroundColorSpan(Color.WHITE))
.append("(" + attachment.getNick() + ") ", new ForegroundColorSpan(roomTipColor),
new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {
if (clickConsumer != null) {
Single.just(String.valueOf(attachment.getUid())).subscribe(clickConsumer);
}
}
})
.append("已清空公屏消息", new ForegroundColorSpan(Color.WHITE));
tvContent.setText(text.build());
tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod());
}
private void setMonsterNotifyMessage(TextView tvContent, String notifyMessage) {
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(notifyMessage, new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.color_34D08B)));

View File

@@ -833,7 +833,12 @@ public final class IMNetEaseManager {
}
} else if (second == CUSTOM_MSG_UPDATE_ROOM_INFO_NOTICE) {
addMessages(msg);
} else {
}
else if (second == CUSTOM_MSG_UPDATE_ROOM_INFO_CLEAN_SCREEN) {
noticeRoomEvent(msg,RoomEvent.ROOM_CLEAN_SCREEN);
AvRoomDataManager.get().chatRoomDataRelease(true);
addMessages(msg);
}else {
noticeUpdateRoomInfo((CustomAttachment) attachment);
}
break;

View File

@@ -0,0 +1,51 @@
package com.yizhuan.xchat_android_core.im.custom.bean;
import com.alibaba.fastjson.JSONObject;
public class CleanScreenAttachment extends CustomAttachment {
private long uid;
private String nick;
private int roleType;
public CleanScreenAttachment(int first, int second) {
super(first, second);
}
public long getUid() {
return uid;
}
public void setUid(long uid) {
this.uid = uid;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
public int getRoleType() {
return roleType;
}
public void setRoleType(int roleType) {
this.roleType = roleType;
}
@Override
protected void parseData(JSONObject data) {
uid = data.getLongValue("uid");
nick = data.getString("nick");
roleType = data.getIntValue("roleType");
}
@Override
protected JSONObject packData() {
return null;
}
}

View File

@@ -63,6 +63,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_SINGLE_MAGIC;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_AUDIO;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLEAN_SCREEN;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_GIFT;
@@ -116,6 +117,16 @@ import com.yizhuan.xchat_android_library.utils.log.MLog;
public class CustomAttachParser implements MsgAttachmentParser {
private static final String TAG = "CustomAttachParser";
public static String packData(int first, int second, JSONObject data) {
JSONObject object = new JSONObject();
object.put("first", first);
object.put("second", second);
if (data != null) {
object.put("data", data);
}
return object.toJSONString();
}
// 根据解析到的消息类型,确定附件对象类型
@Override
public MsgAttachment parse(String json) {
@@ -226,7 +237,10 @@ public class CustomAttachParser implements MsgAttachmentParser {
break;
case CUSTOM_MSG_UPDATE_ROOM_INFO_NOTICE:
attachment = new RoomNoticeAttachment(CUSTOM_MSG_UPDATE_ROOM_INFO, CUSTOM_MSG_UPDATE_ROOM_INFO_NOTICE);
attachment = new RoomNoticeAttachment(CUSTOM_MSG_UPDATE_ROOM_INFO, second);
break;
case CUSTOM_MSG_UPDATE_ROOM_INFO_CLEAN_SCREEN:
attachment = new CleanScreenAttachment(CUSTOM_MSG_UPDATE_ROOM_INFO, second);
break;
}
break;
@@ -567,7 +581,7 @@ public class CustomAttachParser implements MsgAttachmentParser {
attachment = new SingleRoomRankAttachment(second);
break;
default:
LogUtils.e("未定义的first,请现在CustomAttachParser中解析");
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
break;
}
JSONObject data = object.getJSONObject("data");
@@ -580,15 +594,4 @@ public class CustomAttachParser implements MsgAttachmentParser {
return attachment;
}
public static String packData(int first, int second, JSONObject data) {
JSONObject object = new JSONObject();
object.put("first", first);
object.put("second", second);
if (data != null) {
object.put("data", data);
}
return object.toJSONString();
}
}

View File

@@ -12,63 +12,46 @@ import com.yizhuan.xchat_android_core.noble.NobleInfo;
* @date 2017/6/8
*/
public class CustomAttachment implements MsgAttachment {
/** 自定义消息附件的类型,根据该字段区分不同的自定义消息 */
protected int first;
protected int second;
protected JSONObject data;
protected NobleInfo mNobleInfo;
public static final int CUSTOM_MSG_HEADER_TYPE_AUCTION = 1;
public static final int CUSTOM_MSG_SUB_TYPE_AUCTION_START = 11;
public static final int CUSTOM_MSG_SUB_TYPE_AUCTION_FINISH = 12;
public static final int CUSTOM_MSG_SUB_TYPE_AUCTION_UPDATE = 13;
public static final int CUSTOM_MSG_HEADER_TYPE_ROOM_TIP = 2;
public static final int CUSTOM_MSG_SUB_TYPE_ROOM_TIP_SHARE_ROOM = 21;
public static final int CUSTOM_MSG_SUB_TYPE_ROOM_TIP_ATTENTION_ROOM_OWNER = 22;
public static final int CUSTOM_MSG_HEADER_TYPE_GIFT = 3;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_GIFT = 31; //普通单人送礼公屏
public static final int CUSTOM_MSG_ALL_SERVICE_GIFT = 32;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT = 34;//单人福袋送礼公屏
public static final int CUSTOM_MSG_HEADER_TYPE_ACCOUNT = 5;
public static final int CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI = 6;
public static final int CUSTOM_MSG_HEADER_TYPE_QUEUE = 8;
public static final int CUSTOM_MSG_HEADER_TYPE_QUEUE_INVITE = 81;
public static final int CUSTOM_MSG_HEADER_TYPE_QUEUE_KICK = 82;
public static final int CUSTOM_MSG_HEADER_TYPE_FACE = 9;
public static final int CUSTOM_MSG_SUB_TYPE_FACE_SEND = 91;
public static final int CUSTOM_MSG_HEADER_TYPE_NOTICE = 10;
public static final int CUSTOM_MSG_HEADER_TYPE_PACKET = 11;
public static final int CUSTOM_MSG_SUB_TYPE_PACKET_FIRST = 111;
//送礼物
public static final int CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT = 12;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_MULTI_GIFT = 121;//普通全麦
public static final int CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT = 123;// 普通多人
public static final int CUSTOM_MSG_SUB_TYPE_SEND_ALL_MIC_LUCKY_GIFT = 125;// 福袋全麦
public static final int CUSTOM_MSG_SUB_TYPE_SEND_MULTI_LUCK_GIFT = 124;// 福袋多人
//转盘抽奖
public static final int CUSTOM_MSG_HEADER_TYPE_LOTTERY = 13;
public static final int CUSTOM_MSG_SUB_TYPE_NOTI_LOTTERY = 131;
// 贵族
public static final int CUSTOM_MESS_HEAD_NOBLE = 14;
/** 靓号未生效提醒 */
/**
* 靓号未生效提醒
*/
public static final int CUSTOM_MSG_HEADER_TYPE_GOOD_NUMBER_INACTIVE = 147;
/** 贵族快到期(前三天)消息 */
/**
* 贵族快到期(前三天)消息
*/
public static final int CUSTOM_MSG_HEADER_TYPE_NOBLE_END = 144;
// 开通贵族
public static final int CUSTOM_MESS_SUB_OPENNOBLE = 142;
// 续费贵族
@@ -81,75 +64,67 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MESS_SUB_ROOM_INCOME = 148;
// 推荐房间
public static final int CUSTOM_MESS_SUB_RECOM_ROOM = 149;
/** 进场横幅 (客户端定义) */
/**
* 进场横幅 (客户端定义)
*/
public static final int CUSTOM_MESS_SUB_ROOM_WELCOME = 141;
// 座驾
public static final int CUSTOM_MESS_HEAD_CAR = 15;
// 座驾已到期
public static final int CUSTOM_MESS_SUB_CAR_EXPIRE = 151;
public static final int CUSTOM_MESS_SUB_CAR_ENTER_ROOM = 159;
// 送魔法协议
public static final int CUSTOM_MSG_HEADER_TYPE_SEND_MAGIC = 16;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_SINGLE_MAGIC = 161;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_MULTI_MAGIC = 162;
public static final int CUSTOM_MSG_SUB_TYPE_BATCH_SEND_MAGIC = 163;//送魔法给一个或者多个人
// 打怪兽
public static final int CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING = 17;
public static final int CUSTOM_MSG_SUB_TYPE_MONSTER_HUNTING = 171;
public static final int CUSTOM_NOTI_SUB_GAME_END = 172;//游戏结束
public static final int CUSTOM_NOTI_SUB_GAME_RESULT = 173; //游戏结果
public static final int CUSTOM_NOTI_SUB_GAME_ATTACK = 174; //攻击
// 踢出房间/拉黑
public static final int CUSTOM_MSG_HEADER_TYPE_KICK_MIC = 18;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_KICK_ROOM = 181;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_ADD_BLACK = 182;
// 小秘书消息 (原先是怪兽奖励消息3.1.2版本后拓展为通用消息)
public static final int CUSTOM_MSG_ASSISTANT_MSG = 19;
// 小秘书通用消息
public static final int CUSTOM_MSG_ASSISTANT_COMMON_MSG = 191;
// 房间信息更新
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO=20;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_GIFT=201;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_AUDIO=202;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN=203;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO = 20;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_GIFT = 201;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_AUDIO = 202;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN = 203;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_NOTICE = 204; // 通用公屏提示文案,使用于各种模式的开和关
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE=205;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE = 205;
public static final int CUSTOM_MSG_UPDATE_ROOM_INFO_CLEAN_SCREEN = 206;
// 群红包
public static final int CUSTOM_MSG_HEADER_TYPE_LUCKY_MONEY = 21;
public static final int CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_MONEY = 211;
public static final int CUSTOM_MSG_SUB_TYPE_RECEIVE_LUCKY_MONEY = 212;
// 应用内分享
public static final int CUSTOM_MSG_HEADER_TYPE_SHARE_IN_APP = 22;
public static final int CUSTOM_MSG_SHARE_ROOM = 221;
public static final int CUSTOM_MSG_SHARE_FAMILY = 222;
public static final int CUSTOM_MSG_SHARE_TEAM = 223;
public static final int CUSTOM_MSG_SHARE_MINI_WORLD = 225;// 分享话题
// 通用系统通知
public static final int CUSTOM_MSG_HEADER_COMMON_SYSTEM_MSG = 23;
public static final int CUSTOM_MSG_SUB_TYPE_COMMON_SYSTEM_MSG_TEXT = 231;
public static final int CUSTOM_MSG_SUB_TYPE_COMMON_SYSTEM_MSG_APPROVAL = 232;
//等级提升弹窗
public static final int CUSTOM_MSG_LEVEL_UP=24;
public static final int CUSTOM_MSG_EXPER_LEVEL_UP=241;
public static final int CUSTOM_MSG_CHARM_LEVEL_UP=242;
public static final int CUSTOM_MSG_EXPER_LEVEL_UP_NOTICE=243;
public static final int CUSTOM_MSG_LEVEL_UP = 24;
public static final int CUSTOM_MSG_EXPER_LEVEL_UP = 241;
public static final int CUSTOM_MSG_CHARM_LEVEL_UP = 242;
public static final int CUSTOM_MSG_EXPER_LEVEL_UP_NOTICE = 243;
//龙珠游戏
public static final int CUSTOM_MSG_DRAGON_BAR=25;
public static final int CUSTOM_MSG_DRAGON_BAR_START=251;
public static final int CUSTOM_MSG_DRAGON_BAR_END=252;
public static final int CUSTOM_MSG_DRAGON_BAR_CANCEL=253;
public static final int CUSTOM_MSG_DRAGON_BAR_RUNAWAY=254;
public static final int CUSTOM_MSG_DRAGON_BAR = 25;
public static final int CUSTOM_MSG_DRAGON_BAR_START = 251;
public static final int CUSTOM_MSG_DRAGON_BAR_END = 252;
public static final int CUSTOM_MSG_DRAGON_BAR_CANCEL = 253;
public static final int CUSTOM_MSG_DRAGON_BAR_RUNAWAY = 254;
//房间开宝箱
public static final int CUSTOM_MSG_BOX = 26;
public static final int CUSTOM_MSG_SUB_BOX_ME = 261;//自己可见
@@ -157,7 +132,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM = 263;//所有房间可见
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY = 264;//所有房间可见+小秘书
public static final int CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA = 265;//所有房间可见+小秘书+高大上的SVGA
//KTV
public static final int CUSTOM_MSG_KTV = 27;
public static final int CUSTOM_MSG_SUB_KTV_ADD = 271;
@@ -172,7 +146,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_KTV_FINISH = 2710;
public static final int CUSTOM_MSG_SUB_KTV_CLOSE = 2711;
public static final int CUSTOM_MSG_SUB_KTV_OPEN = 2712;
// 公聊大厅
public static final int CUSTOM_MSG_PUBLIC_CHAT_HALL = 28;
public static final int CUSTOM_MSG_SUB_PUBLIC_CHAT_HALL_GIFT = 281; // 公聊大厅送礼物
@@ -180,18 +153,15 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_PUBLIC_CHAT_HALL_FULL_SCREEN = 283; // 公聊大厅 霸屏
public static final int CUSTOM_MSG_SUB_PUBLIC_CHAT_HALL_AIT_ME = 284; // @ 人的时候,私聊发给对应的人
public static final int CUSTOM_MSG_SUB_PUBLIC_CHAT_HALL_GAME = 285; // @ 人的时候,私聊发给对应的人
// 排麦
public static final int CUSTOM_MSG_QUEUING_MIC = 30;
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_NON_EMPTY = 301; // 从无人排麦到有人排麦
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_EMPTY = 302; // 从有人排麦到无人排麦
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_MODE_OPEN = 303; // 开启排麦模式
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_MODE_OPEN = 303; // 开启排麦模式
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_MODE_CLOSE = 304; // 关闭排麦模式
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_FREE_MIC_OPEN = 305; // 将坑位设置成自由麦
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_FREE_MIC_CLOSE = 306; // 将坑位设置成排麦
public static final int CUSTOM_MSG_SUB_QUEUING_MIC_UP_MIC = 307; // 管理员将用户抱上麦
// 房间 PK
public static final int CUSTOM_MESS_HEAD_ROOM_PK = 31; //pk模式
public static final int CUSTOM_MESS_SUB_ROOM_PK_NON_EMPTY = 311; //从无人报名pk排麦到有人报名pk排麦
@@ -202,8 +172,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MESS_SUB_ROOM_PK_RESULT = 316; // pk 结果
public static final int CUSTOM_MESS_SUB_ROOM_PK_RE_START = 317; // 重开
public static final int CUSTOM_MESS_SUB_ROOM_PK_INVITE = 318; // 邀请进队
//模厅
/**
* 模厅消息
*/
@@ -211,9 +179,10 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_HALL_APPLY_JOIN = 321;//申请加入厅
public static final int CUSTOM_MSG_SUB_HALL_MANAGER_INVITE = 322;//管理邀请入厅
public static final int CUSTOM_MSG_SUB_HALL_APPLY_EXIT = 323;//申请退出厅
//模厅
public static final int CUSTOM_MSG_SUB_HALL_NOTICE = 324;//模厅通知
public static final int CUSTOM_MSG_SUB_HALL_TO_BE_OWNER = 325;//成为模厅厅主
// 游戏
public static final int CUSTOM_MSG_GAME = 33;
public static final int CUSTOM_MSG_GAME_SELECT = 331; // 确认选择游戏
@@ -224,7 +193,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_GAME_OPEN = 336; // 打开游戏模式
public static final int CUSTOM_MSG_GAME_CLOSE = 337; // 关闭游戏模式
public static final int CUSTOM_MSG_GAME_AI_ENTER = 338; // 游戏ai进入
// 师徒关系
public static final int CUSTOM_MSG_MENTORING_RELATIONSHIP = 34;
public static final int CUSTOM_MSG_SUB_MENTORING_RELATIONSHIP_MISSION_ONE_MASTER = 341; // 师父收到的任务一消息
@@ -241,48 +209,39 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_MENTORING_RELATIONSHIP_MISSION_FAIL_TIPS = 3412; // 任务失败提示
public static final int CUSTOM_MSG_SUB_MENTORING_RELATIONSHIP_MISSION_SHARE_ROOM = 3413; // 徒弟看到的分享房间的链接
public static final int CUSTOM_MSG_SUB_MENTORING_RELATIONSHIP_GRAB_APPRENTICES = 3414; // 抢徒弟推送消息
// 私聊发起游戏
public static final int CUSTOM_MSG_IM_GAME = 35;
public static final int CUSTOM_MSG_IM_REQUST_GAME = 351; // 确认选择游戏
// im系统提示
public static final int CUSTOM_MSG_IM_TIP = 36;
public static final int CUSTOM_MSG_IM_TIP_CANCEL = 361;//取消游戏
public static final int CUSTOM_MSG_IM_TIP_RESULT = 362;//游戏结果
// 接受游戏
public static final int CUSTOM_MSG_GAME_RESPOND = 37;
public static final int CUSTOM_MSG_GAME_RESPOND_ACCEPT = 371;//接受
public static final int CUSTOM_MSG_GAME_RESPOND_CANCEL = 372;//取消
//签到
public static final int CUSTOM_MSG_SIGN_IN = 41;
public static final int CUSTOM_MSG_SUB_JUMP_SIGN_IN_ACTIVITY = 411;//提醒,点击跳转到签到界面
public static final int CUSTOM_MSG_SUB_CARVE_UP_GOLD_SECOND_LEVEL = 412;//瓜分钻石,第二等级,有房间公屏通知
public static final int CUSTOM_MSG_SUB_CARVE_UP_GOLD_THIRD_LEVEL = 413;//瓜分钻石,第三等级,房间公屏+小秘书
//礼物值
public static final int CUSTOM_MSG_ROOM_GIFT_VALUE = 42;
public static final int CUSTOM_MSG_SUB_GIFT_VALUE_SYNC = 421;//房间礼物值同步
// 离开模式
public static final int CUSTOM_MSG_LEAVE_MODE = 43;
public static final int CUSTOM_MSG_LEAVE_MODE_NOTICE = 431; // 给其他客户端发送房主信息(避免再次调用用户信息接口)
// 话匣子
public static final int CUSTOM_MSG_CHATTER_BOX = 44;
public static final int CUSTOM_MSG_CHATTER_BOX_ASK = 441; // 发起游戏
public static final int CUSTOM_MSG_CHATTER_BOX_DROP = 442; // 抛点数
public static final int CUSTOM_MSG_CHATTER_BOX_INIT = 443; // 打招呼
// 声音瓶子
public static final int CUSTOM_MSG_VOICE_BOTTLE_HEAD = 45; // 声音瓶子
public static final int CUSTOM_MSG_VOICE_BOTTLE_SUB_HELLO = 451; // 声音瓶子私聊打招呼
public static final int CUSTOM_MSG_VOICE_BOTTLE_SUB_TO_RECORDING = 452; // 声音瓶子去录制
public static final int CUSTOM_MSG_VOICE_BOTTLE_SUB_tO_MATCHING = 453; // 声音瓶子去匹配
public static final int CUSTOM_MSG_VOICE_BOTTLE_SUB_HEART = 454; // 声音瓶子爱心信息
// 话题
public static final int CUSTOM_MSG_MINI_WORLD = 46;
public static final int CUSTOM_MSG_GROUP_CHAT_MEMBER_COUNT = 461; // 话题群聊派对人数
@@ -293,15 +252,12 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_ROOM_FOLLOW = 466;//在房间的公屏上关注房主
public static final int CUSTOM_MSG_ROOM_FOLLOW_2 = 467;//在房间的公屏上关注房主,第二个
public static final int CUSTOM_MSG_ROOM_FOLLOW_SUCCESS = 468;//在房间的关注房主,第二个
//全服广播
public static final int CUSTOM_MSG_HEADER_ALL_SERVICE_PUSH = 49;
public static final int CUSTOM_MSG_SUB_TYPE_PUSH_APP_TO_UPDATE = 491;//推送App更新消息
//青少年模式
public static final int CUSTOM_MSG_HEADER_PM_ROOM_LIMIT = 48;
public static final int CUSTOM_MSG_SUB_PM_ROOM_LIMIT_TIME = 481; //到达时间,限制进房
//超管
public static final int CUSTOM_MSG_HEADER_TYPE_SUPER_ADMIN = 50;
public static final int CUSTOM_MSG_SUB_TYPE_SUPER_ADMIN_REMOVE_CP_ROOM_LIMIT = 501;//超管解除陪伴房的进房限制
@@ -312,7 +268,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_TYPE_SUPER_ADMIN_MARK_BLACK = 506;//拉黑
public static final int CUSTOM_MSG_SUB_TYPE_SUPER_ADMIN_KICK_OUT_ROOM = 507;//踢出房间
public static final int CUSTOM_MSG_SUB_TYPE_SUPER_ADMIN_KICK_OUT_ADMIN = 508;//踢管理员出房间
// 移出话题系统通知
public static final int CUSTOM_MSG_HEAD_SHIFT_OUT = 51;
public static final int CUSTOM_MSG_SHIFT_OUT = 511; // 移出话题
@@ -324,83 +279,65 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_DYNAMTC_PASS = 523; // 动态审核
public static final int CUSTOM_MSG_SUB_TYPE_WORLD_DYNAMIC_SHARE = 524; //分享app内好友
public static final int CUSTOM_MSG_SUB_TYPE_WORLD_DYNAMIC_PUBLISH = 525; // 关注用户发了一条动态
//活动的暴走倒计时
public static final int CUSTOM_MSG_HEADER_TYPE_ACTIVITY = 53;
public static final int CUSTOM_MSG_SUB_TYPE_ACTIVITY_TIMER = 531;
//54 55 iOS使用了
//麦上用户 公屏欢迎消息
public static final int CUSTOM_MSG_HEADER_TYPE_PUBLIC_SCREEN = 56;
public static final int CUSTOM_MSG_SUB_TYPE_PUBLIC_SCREEN_WELCOME = 561; //欢迎语
//通用系统通知带路由跳转功能23废弃因为字段乱定义
public static final int CUSTOM_MSG_HEADER_COMMON_SYSTEM_MSG_V2 = 57;
public static final int CUSTOM_MSG_SUB_TYPE_COMMON_SYSTEM_MSG_V2_TEXT = 571;
public static final int CUSTOM_MSG_SUB_TYPE_COMMON_SYSTEM_MSG_V2_APPROVAL = 572;
//54 55 iOS使用了
public static final int CUSTOM_MSG_SUB_TYPE_COMMON_SYSTEM_MSG_V2_APPROVAL = 572;
//系统通知一个通用的头可以往下拓展second
public static final int CUSTOM_MSG_HEADER_TYPE_COMMON_SYS_NOTICATION = 58;
public static final int CUSTOM_MSG_SUB_TYPE_FIRST_RECHARGE_SUCCESS = 581; //首充成功
//收藏房间消息
public static final int CUSTOM_MSG_HEADER_TYPE_FOLLOW_ROOM = 59;
public static final int CUSTOM_MSG_SUB_TYPE_FOLLOW_ROOM_SUCCESS = 591;
//红包消息
public static final int CUSTOM_MSG_RED_PACKAGE = 60;
public static final int CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ROOM_DIAMOND = 602;
public static final int CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND = 604;//全服红包
public static final int CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ROOM_MSG = 605;
//开福袋飘屏
public static final int CUSTOM_MSG_LUCKY_GIFT = 61;
public static final int CUSTOM_MSG_LUCKY_GIFT_ROOM_NOTIFY = 610;// 福袋礼物房间飘屏通知
public static final int CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY = 611; // 福袋礼物全服飘屏通知
//发现萌新打招呼
public static final int CUSTOM_MSG_NEWBIE = 62;
public static final int CUSTOM_MSG_RECEIV_NEWBIE_HELLO = 621;
//推送消息
public static final int CUSTOM_MSG_PUSH_NOTIFIFICATION = 70;
public static final int CUSTOM_MSG_SUB_PUSH_NOTIFICATION_IN_ROOM = 701;// 推送进入房间
public static final int CUSTOM_MESS_TAROT = 71; //塔罗牌充值消息
public static final int CUSTOM_MESS_TAROT_SUCCESS = 711; //塔罗牌充值中奖消息
//相亲模式
public static final int CUSTOM_MSG_DATING = 72;
public static final int CUSTOM_MSG_SUB_DATING_SELECT = 721;
public static final int CUSTOM_MSG_SUB_DATING_PUBLISH_RESULT = 722;
public static final int CUSTOM_MSG_SUB_DATING_PUBLISH_LIKE = 723;
public static final int CUSTOM_MSG_SUB_DATING_PUBLISH_HEART = 724;
//相亲模式全服飘屏
public static final int CUSTOM_MSG_DATING_All = 73;
public static final int CUSTOM_MSG_SUB_DATING_Al_NOTIFY = 731;
//赛事消息
public static final int CUSTOM_MSG_MATCH = 74;
public static final int CUSTOM_MSG_MATCH_TICKET = 77;
//public static final int CUSTOM_MSG_SUB_MATCH = 741;
public static final int CUSTOM_MSG_QUICK_DISMISS = 745;
public static final int CUSTOM_MSG_QUICK_ENOUGH_QUOTA = 746;
//私聊提示
public static final int CUSTOM_MSG_CHAT_HINT = 75;
public static final int CUSTOM_MSG_SUB_CHAT_HINT = 751;
//首充礼包
public static final int CUSTOM_MSG_FIRST_CHARGE = 76;
public static final int CUSTOM_MSG_SUB_FIRST_CHARGE_PRIZE = 761;
//访客未读
public static final int CUSTOM_MSG_HEADER_TYPE_VISITOR = 78;
public static final int CUSTOM_MSG_SUB_TYPE_VISITOR_UNREAD = 781;
//跨房PK
public static final int CUSTOM_MSG_ROOM_PK = 83;
public static final int CUSTOM_MSG_SUB_ROOM_PK_INVITE = 831;
@@ -409,7 +346,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_ROOM_PK_UPDATE = 834;
public static final int CUSTOM_MSG_SUB_ROOM_PK_FINISH = 835;
public static final int CUSTOM_MSG_SUB_ROOM_PK_NOTIFY = 836;
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_INVITE = 837;// 个播pk发出邀请
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_REFUSE = 838;// 个播pk拒绝邀请
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_ACCEPT = 839;// 个播pk接受邀请
@@ -417,7 +353,6 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_RESULT = 8311;// 个播pk结果通知
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_NOTIFY = 8312;// 个播pk结束触发的飘屏通知
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_PK_FINISH = 8313;// 个播pk结束通知
/**
* 贵族
*/
@@ -426,29 +361,29 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_VIP_ROOM_UPGRADE = 853; // 贵族升级房内消息
public static final int CUSTOM_MSG_VIP_ROOM_ALL_UPGRADE = 856; // 贵族升级全服房间公屏通知消息
public static final int CUSTOM_MSG_VIP_ROOM_BROADCAST = 857; // 贵族小喇叭消息
public static final int CUSTOM_MSG_VIP_SELF_OPEN = 852; // 开通贵族成功系统消息
public static final int CUSTOM_MSG_VIP_SELF_UPGRADE = 854; // 贵族升级系统消息
public static final int CUSTOM_MSG_VIP_USER_ALL_UPGRADE = 855; // 贵族升级全服飘屏通知消息
///个播房观众点击空坑位,房主收到请求上麦提示
public static final int ANCHOR_ROOM_AUDIENCE_UPMIC = 86;
//技能卡审核
public static final int SKILL_MSG_AUDIO = 87;
public static final int CP_INVITE_MESSAGE = 88;
public static final int CP_INVITE_MESSAGE_TOP_NOTICE = 881;
public static final int CUSTOM_MSG_SINGLE_ROOM_RANK = 89;
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_RANK_TOP = 891;
public static final int CUSTOM_MSG_FANS_TEAM = 90;
public static final int CUSTOM_MSG_SUB_FANS_TEAM_OPEN = 901; //开通粉丝团
public static final int CUSTOM_MSG_SUB_FANS_TEAM_OPEN_FAILED = 902; // 开通粉丝团失败
public static final int CUSTOM_MSG_SUB_FANS_TEAM_JOIN = 903; // 加入粉丝团
public static final int CUSTOM_MSG_SUB_FANS_TEAM_EXIT = 904; // 退出粉丝团
/**
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
*/
protected int first;
protected int second;
protected JSONObject data;
protected NobleInfo mNobleInfo;
public CustomAttachment() {

View File

@@ -166,6 +166,9 @@ public final class AvRoomDataManager {
public boolean myIsInQueue = false;
//TRTC SIG
public String trtcSig;
//清空公屏消息时间
public long clearScreenTime;
private Disposable subscribe;
/**
* 一起玩 按钮开关

View File

@@ -229,6 +229,8 @@ public class RoomEvent {
public static final int SINGLE_ROOM_PK_NOTIFY = 88;
public static final int SINGLE_ROOM_RANK_TOP_NOTIFY = 89;
public static final int ROOM_CLEAN_SCREEN = 90;
private int event = NONE;
private int micPosition = Integer.MIN_VALUE;
private int posState = -1;

View File

@@ -194,6 +194,8 @@ public class RoomInfo implements Parcelable,Serializable {
private long mgId;
private String mgName;
private long clearScreenTime;
// /**
// * 房间角标
// */

View File

@@ -624,4 +624,11 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
.compose(RxHelper.handleStringData())
.compose(RxHelper.handleSchedulers());
}
@Override
public Single<String> cleanScreen(long roomUid, long uid) {
return mRoomService.cleanScreen(roomUid, uid)
.compose(RxHelper.handleStringData())
.compose(RxHelper.handleSchAndExce());
}
}

View File

@@ -617,11 +617,11 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
contentJsonObj.put("vipMic", true);
}
if (!TextUtils.isEmpty(userInfo.getMicNickColor())){
if (!TextUtils.isEmpty(userInfo.getMicNickColor())) {
contentJsonObj.put("micNickColor", userInfo.getMicNickColor());
}
if (!TextUtils.isEmpty(userInfo.getMicCircle())){
if (!TextUtils.isEmpty(userInfo.getMicCircle())) {
contentJsonObj.put("micCircle", userInfo.getMicCircle());
}
@@ -1107,6 +1107,18 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
Single<ServiceResult<String>> sendRoomBroadcast(@Field("msg") String msg,
@Field("roomId") long roomId);
/**
* 清空房间公屏
*
* @param roomUid 房间uid
* @param uid 操作人uid
* @return
*/
@FormUrlEncoded
@POST("/room/clear/history/recrod")
Single<ServiceResult<String>> cleanScreen(@Field("roomUid") long roomUid,
@Field("uid") long uid);
}
}

View File

@@ -172,4 +172,6 @@ public interface IAvRoomModel extends IModel {
Single<BroadcastInfo> getBroadcastConfig(int type);
Single<String> sendRoomBroadcast(String msg, long roomId);
Single<String> cleanScreen(long roomUid, long uid);
}

View File

@@ -151,7 +151,7 @@ public class RxHelper {
public static <T> SingleTransformer<T, T> handleException() {
return upstream -> upstream.onErrorResumeNext(throwable -> {
if (throwable instanceof IOException) {
return Single.error(new Throwable("网络异常,加载失败"));
return Single.error(new Throwable("网络异常,请稍后再试!"));
}
return Single.error(throwable);
});