remove the MetaContactChatPanel from the presence status listeners, when it's removed from the chat window

cusax-fix
Yana Stamcheva 19 years ago
parent e2d6eee7a6
commit a4521a845c

@ -21,6 +21,7 @@
import net.java.sip.communicator.impl.gui.main.chat.toolBars.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
@ -288,6 +289,27 @@ public void removeChat(ChatPanel chatPanel)
this.setCurrentChatPanel(currentChatPanel);
}
}
// If this is a MetaContactChatPanel remove it from presence operation
// set status listeners.
if(chatPanel instanceof MetaContactChatPanel)
{
MetaContactChatPanel metaContactChatPanel
= (MetaContactChatPanel) chatPanel;
MetaContact metaContact = metaContactChatPanel.getMetaContact();
Iterator protocolContacts = metaContact.getContacts();
while(protocolContacts.hasNext())
{
Contact subContact = (Contact) protocolContacts.next();
getMainFrame()
.getProtocolPresenceOpSet(subContact.getProtocolProvider())
.removeContactPresenceStatusListener(metaContactChatPanel);
}
}
}
/**

Loading…
Cancel
Save