+ ", "
+ userObject.getLastname());
IConnection current = Red5.getConnectionLocal();
String streamId = current.getClient().getId();
RoomClient currentClient = this.clientListManager
.getClientByStreamId(streamId);
// Check if this User is simulated in the OpenMeetings
// Database
log.debug("userObject.getExternalUserId() -1- "
+ userObject.getExternalUserId());
if (userObject.getExternalUserId() != null
&& userObject.getExternalUserId() != null &&
!userObject.getExternalUserId().equals("0")) {
// If so we need to check that we create this user in
// OpenMeetings and update its record
Users user = userManagement.getUserByExternalIdAndType(
userObject.getExternalUserId(),
userObject.getExternalUserType());
if (user == null) {
Configuration conf = cfgManagement.getConfKey(3L,
"default.timezone");
String jName_timeZone = "";
if (conf != null) {
jName_timeZone = conf.getConf_value();
}
long userId = userManagement
.addUserWithExternalKey(1, 0, 0,
userObject.getFirstname(),
userObject.getUsername(),
userObject.getLastname(), 1L, "",
null, null, "",
userObject.getExternalUserId(),
userObject.getExternalUserType(),
true, userObject.getEmail(),
jName_timeZone,
userObject.getPictureUrl());
currentClient.setUser_id(userId);
} else {
user.setPictureuri(userObject.getPictureUrl());
userManagement.updateUser(user);
currentClient.setUser_id(user.getUser_id());
}
}
log.debug("userObject.getExternalUserId() -2- "
+ currentClient.getUser_id());
currentClient
.setUserObject(userObject.getUsername(),
userObject.getFirstname(),
userObject.getLastname());
currentClient.setPicture_uri(userObject.getPictureUrl());
currentClient.setMail(userObject.getEmail());
log.debug("UPDATE USER BY STREAMID " + streamId);
if (currentClient.getUser_id() != null) {
sessionManagement.updateUser(SID,
currentClient.getUser_id());
}
this.clientListManager.updateClientByStreamId(streamId,
currentClient);