identity = (Identity) DBFactory.getInstance().loadObject(identity);
try {
ImPrefsManager ipm = ImPrefsManager.getInstance();
ImPreferences imPrefs = ipm.loadOrCreatePropertiesFor(identity);
if ( (imPrefs != null) ) {
ClientHelper clientHelper = new ClientHelper(olatusername, null, null, null);
entry = new ConnectedUsersListEntry(olatusername, identity.getUser().getPreferences().getLanguage());
entry.setName(identity.getUser().getProperty(UserConstants.LASTNAME, null));
entry.setPrename(identity.getUser().getProperty(UserConstants.FIRSTNAME, null));
entry.setShowAwarenessMessage(imPrefs.isAwarenessVisible());
entry.setShowOnlineTime(imPrefs.isOnlineTimeVisible());
entry.setAwarenessMessage(clientHelper.getStatusMsg());
entry.setInstantMessagingStatus(clientHelper.getStatus());
entry.setLastActivity(lastActivity.get(olatusername));
entry.setOnlineTime(clientHelper.getOnlineTime());
entry.setJabberId(clientHelper.getJid());
entry.setVisibleToOthers(imPrefs.isVisibleToOthers());
entries.add(entry);
//put in cache
sessionItemsCache.put(olatusername, entry);