/**
* Returns all the connected tabs, as well as the user information for the user that owns each
* tab.
*/
void doGetParticipants(Message<JsonObject> event) {
GetWorkspaceParticipantsResponseImpl resp = GetWorkspaceParticipantsResponseImpl.make();
List<ParticipantUserDetailsImpl> collaboratorsArr = new ArrayList<ParticipantUserDetailsImpl>();
Set<Entry<String, ConnectedTab>> collaborators = connectedTabs.entrySet();
for (Entry<String, ConnectedTab> entry : collaborators) {
String userId = entry.getValue().loginInfo.userId;
String username = entry.getValue().loginInfo.username;
ParticipantUserDetailsImpl participantDetails = ParticipantUserDetailsImpl.make();
ParticipantImpl participant = ParticipantImpl.make().setId(entry.getKey()).setUserId(userId);
UserDetailsImpl userDetails = UserDetailsImpl.make()
.setUserId(userId).setDisplayEmail(username).setDisplayName(username)
.setGivenName(username);
participantDetails.setParticipant(participant);
participantDetails.setUserDetails(userDetails);
collaboratorsArr.add(participantDetails);
}
resp.setParticipants(collaboratorsArr);
event.reply(Dto.wrap(resp));
}