From a52586f21725ae91d781a2afcaae1f1e67b2c966 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Tue, 15 Oct 2024 09:07:21 -0300 Subject: [PATCH] refactor (bbb-web): Add more info for Removed User Session. (#21436) * bbb-web: Add more info for Removed User Session. Includes fullname, userExtId and meetingExtId, that will be useful for integrations. * fix userId prop name when fetching from removedUserSession --- .../main/java/org/bigbluebutton/api/MeetingService.java | 3 +++ .../bigbluebutton/api/domain/UserSessionBasicData.java | 3 +++ .../web/controllers/ConnectionController.groovy | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index b49e2f24c2..508324576a 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -202,7 +202,10 @@ public class MeetingService implements MessageListener { UserSessionBasicData removedUser = new UserSessionBasicData(); removedUser.meetingId = us.meetingID; + removedUser.extMeetingId = us.externMeetingID; removedUser.userId = us.internalUserId; + removedUser.extUserId = us.externUserID; + removedUser.userFullName = us.fullname; removedUser.sessionToken = us.authToken; removedUser.role = us.role; removedSessions.put(token, removedUser); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/UserSessionBasicData.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/UserSessionBasicData.java index a845a3869b..459ad9869f 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/UserSessionBasicData.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/UserSessionBasicData.java @@ -22,7 +22,10 @@ package org.bigbluebutton.api.domain; public class UserSessionBasicData { public String sessionToken = null; public String userId = null; + public String extUserId = null; public String meetingId = null; + public String extMeetingId = null; + public String userFullName = null; public String role = null; public Boolean isModerator() { diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ConnectionController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ConnectionController.groovy index e5872b33a7..1f86d8b44b 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ConnectionController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ConnectionController.groovy @@ -115,10 +115,10 @@ class ConnectionController { UserSessionBasicData removedUserSession = meetingService.getRemovedUserSessionWithSessionToken(sessionToken) if(removedUserSession) { response.addHeader("Meeting-Id", removedUserSession.meetingId) - response.addHeader("Meeting-External-Id", removedUserSession.externMeetingID) - response.addHeader("User-Id", removedUserSession.internalUserId) - response.addHeader("User-External-Id", removedUserSession.externUserID) - response.addHeader("User-Name", URLEncoder.encode(removedUserSession.fullname, StandardCharsets.UTF_8.name())) + response.addHeader("Meeting-External-Id", removedUserSession.extMeetingId) + response.addHeader("User-Id", removedUserSession.userId) + response.addHeader("User-External-Id", removedUserSession.extUserId) + response.addHeader("User-Name", URLEncoder.encode(removedUserSession.userFullName, StandardCharsets.UTF_8.name())) response.addHeader("User-Is-Moderator", removedUserSession.isModerator() ? "true" : "false") response.addHeader("User-Is-Presenter", "false") response.setStatus(200)