}
if (!isWebDav) { // leave webdav sessions untouched
if (InstantMessagingModule.isEnabled()) {
// avoid reconnection of dead or duplicate sessions
ClientManager mgr = InstantMessagingModule.getAdapter().getClientManager();
if (username != null && mgr.hasActiveInstantMessagingClient(username)) client = mgr.getInstantMessagingClient(username);
if (log.isDebug()) {
if (client != null) log.debug("Fetched im client via mangager. Connections status is - connected=" + client.isConnected()
+ " for user: " + client.getUsername());
else log.debug("Could not fetch IM client for user: " + username);
}