src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
/**
     * Moves the specified <tt>contact</tt> to the group indicated by
     * <tt>newParent</tt>.
     * @param contact the contact that we'd like moved under the new group.
     * @param newParent the group where we'd like the parent placed.
     */
Moves the specified contact to the group indicated by
newParent.
@param contact the contact that we'd like moved under the new group.
@param newParent the group where we'd like the parent placed.
Moves the specified contact to the group indicated by newParent . @param contact the contact that we ' d like moved under the new group . @param newParent the group where we ' d like the parent placed .
public void moveContact(ContactJabberImpl contact,
                            AbstractContactGroupJabberImpl newParent)
        throws OperationFailedException
    {
        if(!contact.isPersistent())
        {
            String contactAddress = null;
            if(contact instanceof VolatileContactJabberImpl &&
                ((VolatileContactJabberImpl)contact).isPrivateMessagingContact())
            {
               contactAddress = contact.getPersistableAddress();
            }
            else
            {
                contactAddress = contact.getAddress();
            }
            try
            {
                addContact(newParent, contactAddress);
                return;
            }
            catch(OperationFailedException ex)
            {
                logger.error("Cannot move contact! ", ex);
                throw new OperationFailedException(
                    ex.getMessage(),
                    OperationFailedException.GENERAL_ERROR, ex);
            }
        }
        try
        {
            getParentProvider().getConnection().setReplyTimeout(
                ProtocolProviderServiceJabberImpl.SMACK_PACKET_REPLY_TIMEOUT);
            roster.createEntry(contact.getSourceEntry().getJid(),
                               contact.getDisplayName(),
                               new String[]{newParent.getGroupName()});
            getParentProvider().getConnection().setReplyTimeout(
                SmackConfiguration.getDefaultReplyTimeout());
            newParent.addContact(contact);
        }
        catch (XMPPException
                | InterruptedException
                | NotLoggedInException
                | NotConnectedException
                | NoResponseException ex)
        {
            logger.error("Cannot move contact! ", ex);
            throw new OperationFailedException(
                ex.getMessage(),
                OperationFailedException.GENERAL_ERROR, ex);
        }
    }
public void moveContact ( ContactJabberImpl contact , AbstractContactGroupJabberImpl newParent ) throws OperationFailedException { if ( ! contact . isPersistent ( ) ) { String contactAddress = null ; if ( contact instanceof VolatileContactJabberImpl && ( ( VolatileContactJabberImpl ) contact ) . isPrivateMessagingContact ( ) ) { contactAddress = contact . getPersistableAddress ( ) ; } else { contactAddress = contact . getAddress ( ) ; } try { addContact ( newParent , contactAddress ) ; return ; } catch ( OperationFailedException ex ) { logger . error ( "Cannot move contact! " , ex ) ; throw new OperationFailedException ( ex . getMessage ( ) , OperationFailedException . GENERAL_ERROR , ex ) ; } } try { getParentProvider ( ) . getConnection ( ) . setReplyTimeout ( ProtocolProviderServiceJabberImpl . SMACK_PACKET_REPLY_TIMEOUT ) ; roster . createEntry ( contact . getSourceEntry ( ) . getJid ( ) , contact . getDisplayName ( ) , new String [ ] { newParent . getGroupName ( ) } ) ; getParentProvider ( ) . getConnection ( ) . setReplyTimeout ( SmackConfiguration . getDefaultReplyTimeout ( ) ) ; newParent . addContact ( contact ) ; } catch ( XMPPException | InterruptedException | NotLoggedInException | NotConnectedException | NoResponseException ex ) { logger . error ( "Cannot move contact! " , ex ) ; throw new OperationFailedException ( ex . getMessage ( ) , OperationFailedException . GENERAL_ERROR , ex ) ; } }
Moves the specified <tt>contact</tt> to the group indicated by
 <tt>newParent</tt>.
Moves the specified <tt > contact< / tt > to the group indicated by <tt > newParent< / tt > .
// when the contact is not persistent, coming // from NotInContactList group, we need just to add it to the list // will create the entry with the new group so it can be removed // from other groups if any // modify our reply timeout because some XMPP may send "result" IQ // late (> 5 secondes).