|
@@ -953,48 +953,54 @@ public class RoomServiceImpl implements RoomService {
|
|
|
roomMemberDao.deleteUserByRidAndUid(roomId, userId);
|
|
|
// 删除群组信息
|
|
|
roomDao.deleteByRid(roomId);
|
|
|
- // 删除白板信息
|
|
|
- deleteWhiteboardByUser(roomId, userId);
|
|
|
- // 删除群组
|
|
|
- this.dismissImGroup(userId, roomId, courseSchedule.getServiceProvider());
|
|
|
- //关闭所有曲目播放
|
|
|
- courseScheduleStudentMusicScoreDao.closePlayStatus(courseSchedule.getId(), null, null);
|
|
|
+
|
|
|
+ if (GroupType.LIVE != courseSchedule.getGroupType()) {
|
|
|
+ // 删除白板信息
|
|
|
+ deleteWhiteboardByUser(roomId, userId);
|
|
|
+ // 删除群组
|
|
|
+ this.dismissImGroup(userId, roomId, courseSchedule.getServiceProvider());
|
|
|
+ //关闭所有曲目播放
|
|
|
+ courseScheduleStudentMusicScoreDao.closePlayStatus(courseSchedule.getId(), null, null);
|
|
|
+ }
|
|
|
log.info("leaveRoomSuccess dismiss the room: {}, userId: {}, role={}", roomId, userId, roleEnum.name());
|
|
|
} else {
|
|
|
roomMemberDao.deleteUserByRidAndUid(roomId, userId);
|
|
|
|
|
|
- // 获取RTC服务提供方
|
|
|
- String rtcServiceProvider = Optional.ofNullable(courseSchedule.getServiceProvider()).orElse("rongCloud");
|
|
|
-
|
|
|
- RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(rtcServiceProvider);
|
|
|
- if (rtcServiceProvider.equals(TencentCloudRTCPlugin.PLUGIN_NAME)) {
|
|
|
- // 腾讯云RTC服务
|
|
|
- RTCRoomMessage.MessageContent messageContent = RTCRoomMessage.MessageContent
|
|
|
- .builder()
|
|
|
- .action(EMemberAction.LEAVE.getValue())
|
|
|
- .role(roleEnum.getValue())
|
|
|
- .handUpOn(false)
|
|
|
- .timestamp(System.currentTimeMillis())
|
|
|
- .microphone(false)
|
|
|
- .camera(false)
|
|
|
- .sendUserInfo(getSendUser(userId, roleEnum))
|
|
|
- .build();
|
|
|
-
|
|
|
- RTCRoomMessage roomMessage = RTCRoomMessage.builder()
|
|
|
- .objectName(RTCRoomMessage.MEMBER_CHANGE_MESSAGE)
|
|
|
- .toChatRoomId(roomId)
|
|
|
- .content(messageContent)
|
|
|
- .fromUserId(userId)
|
|
|
- .isPersisted(1)
|
|
|
- .isIncludeSender(1)
|
|
|
- .build();
|
|
|
-
|
|
|
- pluginService.sendChatRoomMessage(roomMessage);
|
|
|
- } else {
|
|
|
- MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, roleEnum.getValue());
|
|
|
- msg.setUserName(username);
|
|
|
- imHelper.publishMessage(userId, roomId, msg);
|
|
|
+ if (GroupType.LIVE != courseSchedule.getGroupType()) {
|
|
|
+
|
|
|
+ // 获取RTC服务提供方
|
|
|
+ String rtcServiceProvider = Optional.ofNullable(courseSchedule.getServiceProvider()).orElse("rongCloud");
|
|
|
+
|
|
|
+ RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(rtcServiceProvider);
|
|
|
+ if (rtcServiceProvider.equals(TencentCloudRTCPlugin.PLUGIN_NAME)) {
|
|
|
+ // 腾讯云RTC服务
|
|
|
+ RTCRoomMessage.MessageContent messageContent = RTCRoomMessage.MessageContent
|
|
|
+ .builder()
|
|
|
+ .action(EMemberAction.LEAVE.getValue())
|
|
|
+ .role(roleEnum.getValue())
|
|
|
+ .handUpOn(false)
|
|
|
+ .timestamp(System.currentTimeMillis())
|
|
|
+ .microphone(false)
|
|
|
+ .camera(false)
|
|
|
+ .sendUserInfo(getSendUser(userId, roleEnum))
|
|
|
+ .build();
|
|
|
+
|
|
|
+ RTCRoomMessage roomMessage = RTCRoomMessage.builder()
|
|
|
+ .objectName(RTCRoomMessage.MEMBER_CHANGE_MESSAGE)
|
|
|
+ .toChatRoomId(roomId)
|
|
|
+ .content(messageContent)
|
|
|
+ .fromUserId(userId)
|
|
|
+ .isPersisted(1)
|
|
|
+ .isIncludeSender(1)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ pluginService.sendChatRoomMessage(roomMessage);
|
|
|
+ } else {
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, roleEnum.getValue());
|
|
|
+ msg.setUserName(username);
|
|
|
+ imHelper.publishMessage(userId, roomId, msg);
|
|
|
// imHelper.quit(new String[]{userId}, roomId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
log.info("leaveRoomSuccess quit group: roomId={},userId: {}", roomId, userId);
|