mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Minor tweaks using timers.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@7573 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -33,6 +33,7 @@ import org.jivesoftware.spark.ui.ContactItem;
|
||||
import org.jivesoftware.spark.ui.ContactList;
|
||||
import org.jivesoftware.spark.ui.conferences.ConferencePlugin;
|
||||
import org.jivesoftware.spark.ui.status.StatusBar;
|
||||
import org.jivesoftware.spark.util.SwingTimerTask;
|
||||
import org.jivesoftware.spark.util.TaskEngine;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
import org.jivesoftware.sparkimpl.plugin.manager.Enterprise;
|
||||
@ -243,21 +244,18 @@ public class Workspace extends JPanel implements PacketListener {
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
// Load the offline messages after 10 seconds.
|
||||
TaskEngine.getInstance().schedule(new TimerTask() {
|
||||
public void run() {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
for (Message offlineMessage : offlineMessages) {
|
||||
handleOfflineMessage(offlineMessage);
|
||||
}
|
||||
// Loads offline messages after a 1000 second delay.
|
||||
final TimerTask offlineTask = new SwingTimerTask() {
|
||||
public void doRun() {
|
||||
for (Message offlineMessage : offlineMessages) {
|
||||
handleOfflineMessage(offlineMessage);
|
||||
}
|
||||
|
||||
offlineMessages.clear();
|
||||
}
|
||||
});
|
||||
offlineMessages.clear();
|
||||
}
|
||||
}, 10000);
|
||||
};
|
||||
|
||||
TaskEngine.getInstance().schedule(offlineTask, 10000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user