Commit e24982fd authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

1) Update offline cache when user goes offline.

2) Use offline cache to figure out if we need to store offline info in the database.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6365 b35dd754-fafc-0310-a699-88a17e54d16e
parent 37c43c81
......@@ -232,6 +232,18 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
// Keep track of the time when the user went offline
java.util.Date offlinePresenceDate = new java.util.Date();
boolean addedToCache;
if (offlinePresence == null) {
addedToCache = !NULL_STRING.equals(offlinePresenceCache.put(username, NULL_STRING));
}
else {
addedToCache = !offlinePresence.equals(offlinePresenceCache.put(username, offlinePresence));
}
if (!addedToCache) {
return;
}
lastActivityCache.put(username, offlinePresenceDate.getTime());
// Insert data into the database.
Connection con = null;
PreparedStatement pstmt = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment