src/net/java/sip/communicator/impl/protocol/jabber/OperationSetTypingNotificationsJabberImpl.java
/**
         * The method is called by a ProtocolProvider implementation whenver
         * a change in the registration state of the corresponding provider had
         * occurred.
         * @param evt ProviderStatusChangeEvent the event describing the status
         * change.
         */
The method is called by a ProtocolProvider implementation whenver
a change in the registration state of the corresponding provider had
occurred.
@param evt ProviderStatusChangeEvent the event describing the status
change.
The method is called by a ProtocolProvider implementation whenver a change in the registration state of the corresponding provider had occurred . @param evt ProviderStatusChangeEvent the event describing the status change .
public void registrationStateChanged(RegistrationStateChangeEvent evt)
        {
            if (logger.isDebugEnabled())
                logger.debug("The provider changed state from: "
                         + evt.getOldState()
                         + " to: " + evt.getNewState());
            if (evt.getNewState() == RegistrationState.REGISTERED)
            {
                opSetPersPresence =
                    (OperationSetPersistentPresenceJabberImpl) parentProvider
                        .getOperationSet(OperationSetPersistentPresence.class);
                opSetBasicIM =
                    (OperationSetBasicInstantMessagingJabberImpl)parentProvider
                        .getOperationSet(
                            OperationSetBasicInstantMessaging.class);
                messageEventManager = MessageEventManager.getInstanceFor(
                    parentProvider.getConnection());
                messageEventManager.addMessageEventRequestListener(
                    new JabberMessageEventRequestListener());
                messageEventManager.addMessageEventNotificationListener(
                    new IncomingMessageEventsListener());
                if(smackChatStateListener == null)
                    smackChatStateListener = new SmackChatStateListener();
                parentProvider.getConnection().addAsyncStanzaListener(
                    smackChatStateListener,
                    new StanzaTypeFilter(Message.class));
            }
            else if(evt.getNewState() == RegistrationState.UNREGISTERED
                 || evt.getNewState() == RegistrationState.AUTHENTICATION_FAILED
                 || evt.getNewState() == RegistrationState.CONNECTION_FAILED)
            {
                if(parentProvider.getConnection() != null)
                {
                    parentProvider.getConnection()
                        .removeAsyncStanzaListener(smackChatStateListener);
                }
                smackChatStateListener = null;
                messageEventManager = null;
            }
        }
public void registrationStateChanged ( RegistrationStateChangeEvent evt ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "The provider changed state from: " + evt . getOldState ( ) + " to: " + evt . getNewState ( ) ) ; if ( evt . getNewState ( ) == RegistrationState . REGISTERED ) { opSetPersPresence = ( OperationSetPersistentPresenceJabberImpl ) parentProvider . getOperationSet ( OperationSetPersistentPresence . class ) ; opSetBasicIM = ( OperationSetBasicInstantMessagingJabberImpl ) parentProvider . getOperationSet ( OperationSetBasicInstantMessaging . class ) ; messageEventManager = MessageEventManager . getInstanceFor ( parentProvider . getConnection ( ) ) ; messageEventManager . addMessageEventRequestListener ( new JabberMessageEventRequestListener ( ) ) ; messageEventManager . addMessageEventNotificationListener ( new IncomingMessageEventsListener ( ) ) ; if ( smackChatStateListener == null ) smackChatStateListener = new SmackChatStateListener ( ) ; parentProvider . getConnection ( ) . addAsyncStanzaListener ( smackChatStateListener , new StanzaTypeFilter ( Message . class ) ) ; } else if ( evt . getNewState ( ) == RegistrationState . UNREGISTERED || evt . getNewState ( ) == RegistrationState . AUTHENTICATION_FAILED || evt . getNewState ( ) == RegistrationState . CONNECTION_FAILED ) { if ( parentProvider . getConnection ( ) != null ) { parentProvider . getConnection ( ) . removeAsyncStanzaListener ( smackChatStateListener ) ; } smackChatStateListener = null ; messageEventManager = null ; } }
The method is called by a ProtocolProvider implementation whenver
 a change in the registration state of the corresponding provider had
 occurred.
The method is called by a ProtocolProvider implementation whenver a change in the registration state of the corresponding provider had occurred .