src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
/**
     * Removes a contact from the serverside list
     * Event will come for successful operation
     * @param contactToRemove ContactJabberImpl
     */
Removes a contact from the serverside list
Event will come for successful operation
@param contactToRemove ContactJabberImpl
Removes a contact from the serverside list Event will come for successful operation @param contactToRemove ContactJabberImpl
void removeContact(ContactJabberImpl contactToRemove)
        throws OperationFailedException
    {
        if(contactToRemove instanceof VolatileContactJabberImpl)
        {
            contactDeleted(contactToRemove);
            return;
        }
        try
        {
            RosterEntry entry = contactToRemove.getSourceEntry();
            if (entry != null)
                this.roster.removeEntry(entry);
        }
        catch (XMPPErrorException ex)
        {
            String errTxt = "Error removing contact";
            logger.error(errTxt, ex);
            int errorCode = OperationFailedException.INTERNAL_ERROR;
            XMPPError err = ex.getXMPPError();
            if(err != null)
            {
                switch (err.getCondition())
                {
                    case forbidden:
                    case not_allowed:
                    case not_authorized:
                        errorCode = OperationFailedException.FORBIDDEN;
                        break;
                }
                errTxt = err.getConditionText();
            }
            throw new OperationFailedException(errTxt, errorCode, ex);
        }
        catch (InterruptedException
                | NotLoggedInException
                | NotConnectedException
                | NoResponseException ex)
        {
            throw new OperationFailedException(
                    "Could not remove contact",
                    OperationFailedException.GENERAL_ERROR,
                    ex);
        }
    }
void removeContact ( ContactJabberImpl contactToRemove ) throws OperationFailedException { if ( contactToRemove instanceof VolatileContactJabberImpl ) { contactDeleted ( contactToRemove ) ; return ; } try { RosterEntry entry = contactToRemove . getSourceEntry ( ) ; if ( entry != null ) this . roster . removeEntry ( entry ) ; } catch ( XMPPErrorException ex ) { String errTxt = "Error removing contact" ; logger . error ( errTxt , ex ) ; int errorCode = OperationFailedException . INTERNAL_ERROR ; XMPPError err = ex . getXMPPError ( ) ; if ( err != null ) { switch ( err . getCondition ( ) ) { case forbidden : case not_allowed : case not_authorized : errorCode = OperationFailedException . FORBIDDEN ; break ; } errTxt = err . getConditionText ( ) ; } throw new OperationFailedException ( errTxt , errorCode , ex ) ; } catch ( InterruptedException | NotLoggedInException | NotConnectedException | NoResponseException ex ) { throw new OperationFailedException ( "Could not remove contact" , OperationFailedException . GENERAL_ERROR , ex ) ; } }
Removes a contact from the serverside list
 Event will come for successful operation
 @param contactToRemove ContactJabberImpl
Removes a contact from the serverside list Event will come for successful operation @param contactToRemove ContactJabberImpl
//don't try to remove non-existing contacts.