mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
Fixed bad presence issue occuring during a race condition with notifications.
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@5535 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -51,23 +51,6 @@ import org.jivesoftware.sparkimpl.profile.VCardManager;
|
||||
import org.jivesoftware.sparkimpl.settings.local.LocalPreferences;
|
||||
import org.jivesoftware.sparkimpl.settings.local.SettingsManager;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@ -95,6 +78,23 @@ import java.util.StringTokenizer;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
public final class ContactList extends JPanel implements ActionListener, ContactGroupListener, Plugin, RosterListener, ConnectionListener {
|
||||
private JPanel mainPanel = new JPanel();
|
||||
private JScrollPane treeScroller;
|
||||
@ -296,7 +296,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
||||
|
||||
}
|
||||
|
||||
private void moveToOfflineGroup(String bareJID) {
|
||||
private void moveToOfflineGroup(final String bareJID) {
|
||||
final Iterator groupIterator = new ArrayList(groupList).iterator();
|
||||
while (groupIterator.hasNext()) {
|
||||
final ContactGroup group = (ContactGroup)groupIterator.next();
|
||||
@ -313,6 +313,12 @@ public final class ContactList extends JPanel implements ActionListener, Contact
|
||||
|
||||
timer.schedule(new TimerTask() {
|
||||
public void run() {
|
||||
Roster roster = SparkManager.getConnection().getRoster();
|
||||
Presence userPresence = roster.getPresence(bareJID);
|
||||
if (userPresence != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
item.setPresence(null);
|
||||
|
||||
// Check for ContactItemHandler.
|
||||
|
||||
Reference in New Issue
Block a user