src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
/**
     * Handles moving of contact from one group to another.
     *
     * @param oldGroup old group of the contact.
     * @param newGroup new group of the contact.
     * @param contact contact to move
     */
Handles moving of contact from one group to another.
@param oldGroup old group of the contact.
@param newGroup new group of the contact.
@param contact contact to move
Handles moving of contact from one group to another . @param oldGroup old group of the contact . @param newGroup new group of the contact . @param contact contact to move
private void contactMoved(ContactGroup oldGroup,
        ContactGroup newGroup, ContactJabberImpl contact)
    {
        if(oldGroup instanceof ContactGroupJabberImpl)
            ((ContactGroupJabberImpl)oldGroup).
                removeContact(contact);
        else if(oldGroup instanceof RootContactGroupJabberImpl)
            ((RootContactGroupJabberImpl)oldGroup).
                removeContact(contact);
        if(newGroup instanceof ContactGroupJabberImpl)
            ((ContactGroupJabberImpl)newGroup).
                addContact(contact);
        else if(newGroup instanceof RootContactGroupJabberImpl)
            ((RootContactGroupJabberImpl)newGroup).
                addContact(contact);
        fireContactMoved(oldGroup,
            newGroup,
            contact);
        if(oldGroup instanceof ContactGroupJabberImpl
           && oldGroup.countContacts() == 0)
        {
            rootGroup.removeSubGroup(
                (ContactGroupJabberImpl)oldGroup);
            fireGroupEvent(
                (ContactGroupJabberImpl)oldGroup,
                ServerStoredGroupEvent.GROUP_REMOVED_EVENT);
        }
    }
private void contactMoved ( ContactGroup oldGroup , ContactGroup newGroup , ContactJabberImpl contact ) { if ( oldGroup instanceof ContactGroupJabberImpl ) ( ( ContactGroupJabberImpl ) oldGroup ) . removeContact ( contact ) ; else if ( oldGroup instanceof RootContactGroupJabberImpl ) ( ( RootContactGroupJabberImpl ) oldGroup ) . removeContact ( contact ) ; if ( newGroup instanceof ContactGroupJabberImpl ) ( ( ContactGroupJabberImpl ) newGroup ) . addContact ( contact ) ; else if ( newGroup instanceof RootContactGroupJabberImpl ) ( ( RootContactGroupJabberImpl ) newGroup ) . addContact ( contact ) ; fireContactMoved ( oldGroup , newGroup , contact ) ; if ( oldGroup instanceof ContactGroupJabberImpl && oldGroup . countContacts ( ) == 0 ) { rootGroup . removeSubGroup ( ( ContactGroupJabberImpl ) oldGroup ) ; fireGroupEvent ( ( ContactGroupJabberImpl ) oldGroup , ServerStoredGroupEvent . GROUP_REMOVED_EVENT ) ; } }
Handles moving of contact from one group to another.
Handles moving of contact from one group to another .
// the contact is moved to another group // first remove it from the original one // in xmpp if group is empty it is removed