src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
/**
     * Creates an interceptor which modifies presence packet in order to add the
     * the element name "x" and the namespace "vcard-temp:x:update" in order to
     * advertise the avatar SHA-1 hash.
     */
Creates an interceptor which modifies presence packet in order to add the
the element name "x" and the namespace "vcard-temp:x:update" in order to
advertise the avatar SHA-1 hash.
Creates an interceptor which modifies presence packet in order to add the the element name " x " and the namespace " vcard - temp : x : update " in order to advertise the avatar SHA - 1 hash .
public void createAccountPhotoPresenceInterceptor()
    {
        if(this.vCardTempXUpdatePresenceExtension != null)
        {
            return;
        }
        byte[] avatar = null;
        try
        {
            VCardManager manager = VCardManager.getInstanceFor(
                parentProvider.getConnection());
            VCard vCard = manager.loadVCard();
            avatar = vCard.getAvatar();
        }
        catch(XMPPException
            | InterruptedException
            | NotConnectedException
            | NoResponseException ex)
        {
            logger.info("Can not retrieve account avatar for "
                + parentProvider.getOurJID() + ": " + ex.getMessage());
        }
        this.vCardTempXUpdatePresenceExtension =
            new VCardTempXUpdatePresenceExtension(avatar);
        parentProvider.getConnection().addPacketInterceptor(
            new VCardTempXUpdateInterceptor(vCardTempXUpdatePresenceExtension),
            new StanzaTypeFilter(Presence.class));
    }
public void createAccountPhotoPresenceInterceptor ( ) { if ( this . vCardTempXUpdatePresenceExtension != null ) { return ; } byte [ ] avatar = null ; try { VCardManager manager = VCardManager . getInstanceFor ( parentProvider . getConnection ( ) ) ; VCard vCard = manager . loadVCard ( ) ; avatar = vCard . getAvatar ( ) ; } catch ( XMPPException | InterruptedException | NotConnectedException | NoResponseException ex ) { logger . info ( "Can not retrieve account avatar for " + parentProvider . getOurJID ( ) + ": " + ex . getMessage ( ) ) ; } this . vCardTempXUpdatePresenceExtension = new VCardTempXUpdatePresenceExtension ( avatar ) ; parentProvider . getConnection ( ) . addPacketInterceptor ( new VCardTempXUpdateInterceptor ( vCardTempXUpdatePresenceExtension ) , new StanzaTypeFilter ( Presence . class ) ) ; }
Creates an interceptor which modifies presence packet in order to add the
 the element name "x" and the namespace "vcard-temp:x:update" in order to
 advertise the avatar SHA-1 hash.
Creates an interceptor which modifies presence packet in order to add the the element name " x " and the namespace " vcard - temp : x : update " in order to advertise the avatar SHA - 1 hash .
// Verifies that we creates only one interceptor of this type. // Retrieves the current server avatar. // Creates the presence extension to generates the  the element // name "x" and the namespace "vcard-temp:x:update" containing // the avatar SHA-1 hash. // Intercepts all sent presence packet in order to add the // photo tag.