|
@@ -1005,7 +1005,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
|
|
|
// 消息发送用户
|
|
|
LiveRoomMessage.MessageUser messageUser = null;
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(userid));
|
|
|
if (Objects.nonNull(sysUser)) {
|
|
|
// 发送用户信息
|
|
|
messageUser = LiveRoomMessage.MessageUser
|
|
@@ -1024,18 +1024,20 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
|
|
|
LiveRoomMessage message = LiveRoomMessage.builder()
|
|
|
.isIncludeSender(1)
|
|
|
- .objectName(LiveRoomMessage.LOOKER_LOGIN_OUT)
|
|
|
- .fromUserId(userid)
|
|
|
+ .objectName(LiveRoomMessage.LEAVE)
|
|
|
+ .fromUserId(roomVo.getSpeakerId().toString())
|
|
|
.toChatRoomId(roomVo.getRoomUid())
|
|
|
.content(messageContent)
|
|
|
.build();
|
|
|
try {
|
|
|
- // TODO: 取消用户离开事件消息发送
|
|
|
+ // 黑名单才发送退出消息
|
|
|
//用户离开直播间发送退出房间消息给主讲人
|
|
|
- /*
|
|
|
+ if (!imLiveRoomBlackService.checkBlackUser(Integer.parseInt(userid), roomVo.getRoomUid())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
LivePluginService pluginService = livePluginContext.getPluginService(roomVo.getServiceProvider());
|
|
|
pluginService.sendChatRoomMessage(message);
|
|
|
- */
|
|
|
+
|
|
|
log.info("sendLiveRoomLoginOutMessage>>>> looker LOOKER_LOGIN_OUT : roomId={}, userId={}", roomVo.getRoomUid(), userid);
|
|
|
} catch (Exception e) {
|
|
|
log.error("sendLiveRoomLoginOutMessage>>>> looker error LOOKER_LOGIN_OUT {}", e.getMessage());
|
|
@@ -1380,6 +1382,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
.sendUserId(sysUser.getId().toString())
|
|
|
.sendUserName(sysUser.getUsername())
|
|
|
.avatarUrl(sysUser.getAvatar())
|
|
|
+ .blackFlag(true)
|
|
|
.build();
|
|
|
}
|
|
|
|
|
@@ -1390,7 +1393,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
|
|
|
LiveRoomMessage message = LiveRoomMessage.builder()
|
|
|
.isIncludeSender(1)
|
|
|
- .objectName(LiveRoomMessage.ENTER)
|
|
|
+ .objectName(LiveRoomMessage.WELCOME)
|
|
|
.fromUserId(roomVo.getSpeakerId().toString())
|
|
|
.toChatRoomId(roomUid)
|
|
|
.content(messageContent)
|
|
@@ -2335,15 +2338,24 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
LivePluginService pluginService = livePluginContext.getPluginService(
|
|
|
imLiveBroadcastRoom.getServiceProvider());
|
|
|
try {
|
|
|
- TencentWrapper.LiveStreamState liveStreamState = pluginService
|
|
|
- .liveStreamState(getStreamId(imLiveBroadcastRoom.getRoomUid(),imLiveBroadcastRoom.getSpeakerId()));
|
|
|
- if (liveStreamState == null) {
|
|
|
- log.error("查询直播间流失败,返回结果为空");
|
|
|
+ if (pluginService == null) {
|
|
|
+ log.error("查询直播间流失败,未找到对应的插件");
|
|
|
continue;
|
|
|
}
|
|
|
- log.info("查询直播间流状态:{},roomUid:{}", JSON.toJSONString(liveStreamState), imLiveBroadcastRoom.getRoomUid());
|
|
|
- if (!"active".equals(liveStreamState.getStreamState())) {
|
|
|
- roomDestroy(imLiveBroadcastRoom.getRoomUid());
|
|
|
+ if (pluginService.pluginName().equals(TencentCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
+ TencentWrapper.LiveStreamState liveStreamState = pluginService.liveStreamState(
|
|
|
+ getStreamId(imLiveBroadcastRoom.getRoomUid(), imLiveBroadcastRoom.getSpeakerId()));
|
|
|
+ if (liveStreamState == null) {
|
|
|
+ log.error("查询直播间流失败,返回结果为空");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ log.info("查询直播间流状态:{},roomUid:{}", JSON.toJSONString(liveStreamState), imLiveBroadcastRoom.getRoomUid());
|
|
|
+ if (!"active".equals(liveStreamState.getStreamState())) {
|
|
|
+ roomDestroy(imLiveBroadcastRoom.getRoomUid());
|
|
|
+ }
|
|
|
+ } else if (pluginService.pluginName().equals(RongCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
+ // 融云走原有逻辑
|
|
|
+ destroyExpiredLiveRoom(new Date(), imLiveBroadcastRoom, 0);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
|