[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java

yanas at dev.java.net yanas at dev.java.net
Mon Apr 16 19:51:52 CEST 2007


User: yanas   
Date: 2007-04-16 17:51:52+0000
Log:
 remove the MetaContactChatPanel from the presence status listeners, when it's removed from the chat window

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/
==============================================================================

File [changed]: ChatWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java?r1=1.4&r2=1.5
Delta lines:  +22 -0
--------------------
--- ChatWindow.java	2007-04-16 10:58:29+0000	1.4
+++ ChatWindow.java	2007-04-16 17:51:50+0000	1.5
@@ -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 @@
                 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);
+            }
+        }
     }
     
     /**




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list